Browse Source

* Added some widgets to the Yard Box.

master
freesource 24 years ago
parent
commit
e3c670423e
  1. 52
      gBootRoot

52
gBootRoot

@ -42,7 +42,9 @@ set_locale Gtk;
# http://personal.riverusers.com/~swilhelm/perlgtk/. Please # http://personal.riverusers.com/~swilhelm/perlgtk/. Please
# help support his development of this tutorial. Another good place # help support his development of this tutorial. Another good place
# to learn from is test.pl in the Gtk/samples directory included with # to learn from is test.pl in the Gtk/samples directory included with
# Gtk-Perl. # Gtk-Perl. A good reference can be found at
# http://projects.prosa.it/gtkperl/reference.html
# If you want gBootRoot to do it's stuff somewhere else, change the # If you want gBootRoot to do it's stuff somewhere else, change the
# value for $tmp1. # value for $tmp1.
@ -1071,8 +1073,10 @@ sub yard {
($error = error("$template_dir$template: $!")); ($error = error("$template_dir$template: $!"));
return "ERROR"if $error && $error eq "ERROR"; return "ERROR"if $error && $error eq "ERROR";
my @template = <CONTENTS>; my @template = <CONTENTS>;
close(CONTENTS);
my $stuff = join("",@template); my $stuff = join("",@template);
yard_box($stuff); yard_box($stuff);
} }
else { else {
error_window("Kernel Selection required"); error_window("Kernel Selection required");
@ -1107,7 +1111,7 @@ sub yard_box {
\$yard_window); \$yard_window);
$yard_window->signal_connect("delete_event", \&destroy_window, $yard_window->signal_connect("delete_event", \&destroy_window,
\$yard_window); \$yard_window);
$yard_window->set_usize( 500, 600 ); $yard_window->set_usize( 525, 450 );
$yard_window->set_policy( $true, $true, $false ); $yard_window->set_policy( $true, $true, $false );
$yard_window->set_title( "Yard Box" ); $yard_window->set_title( "Yard Box" );
$yard_window->border_width(0); $yard_window->border_width(0);
@ -1116,7 +1120,12 @@ sub yard_box {
$yard_window->add( $main_vbox ); $yard_window->add( $main_vbox );
$main_vbox->show(); $main_vbox->show();
my $vbox = new Gtk::VBox( $false, 10 ); my $vbox = new Gtk::HBox( $false, 50 );
$vbox->border_width( 10 );
$main_vbox->pack_start( $vbox, $false, $true, 0 );
$vbox->show();
$vbox = new Gtk::VBox( $false, 10 );
$vbox->border_width( 10 ); $vbox->border_width( 10 );
$main_vbox->pack_start( $vbox, $true, $true, 0 ); $main_vbox->pack_start( $vbox, $true, $true, 0 );
$vbox->show(); $vbox->show();
@ -1128,8 +1137,15 @@ sub yard_box {
$table->show( ); $table->show( );
# Create the GtkText widget # Create the GtkText widget
my $length;
my $text = new Gtk::Text( undef, undef ); my $text = new Gtk::Text( undef, undef );
$text->set_editable($true); $text->set_editable($true);
my $start_length = $text->get_length();
my $beginning_text = $text->get_chars(0,$length);
$text->signal_connect("changed", sub {
$length = $text->get_length();
#my $changed_text = $text->get_chars(0,$length);
print "$length\n"; } );
$table->attach( $text, 0, 1, 0, 1, $table->attach( $text, 0, 1, 0, 1,
[ 'expand', 'shrink', 'fill' ], [ 'expand', 'shrink', 'fill' ],
[ 'expand', 'shrink', 'fill' ], [ 'expand', 'shrink', 'fill' ],
@ -1145,26 +1161,36 @@ sub yard_box {
my $vscrollbar = new Gtk::VScrollbar( $text->vadj ); my $vscrollbar = new Gtk::VScrollbar( $text->vadj );
$table->attach( $vscrollbar, 1, 2, 0, 1, 'fill', $table->attach( $vscrollbar, 1, 2, 0, 1, 'fill',
[ 'expand', 'shrink', 'fill' ], 0, 0 ); [ 'expand', 'shrink', 'fill' ], 0, 0 );
##my $logadj = $vscrollbar->get_adjustment();
##logadj($logadj);
$vscrollbar->show(); $vscrollbar->show();
my $separator = new Gtk::HSeparator(); my $separator = new Gtk::HSeparator();
$main_vbox->pack_start( $separator, $false, $true, 0 ); $main_vbox->pack_start( $separator, $false, $true, 0 );
$separator->show(); $separator->show();
$vbox = new Gtk::VBox( $false, 10 ); $vbox = new Gtk::HBox( $false, 10 );
$vbox->border_width( 10 ); $vbox->border_width( 10 );
$main_vbox->pack_start( $vbox, $false, $true, 0 ); $main_vbox->pack_start( $vbox, $false, $true, 0 );
$vbox->show(); $vbox->show();
#my $button = new Gtk::Button( "Close" ); # Continue - Cancel - Save Buttons
#$button->signal_connect( 'clicked', ##################################
# sub { destroy $yard_window; } ); my $button = new Gtk::Button( "Continue" );
#$vbox->pack_start( $button, $true, $true, 0 ); $button->signal_connect( 'clicked',
#$button->can_default( $true ); sub { destroy $yard_window; } );
#$button->grab_default(); $vbox->pack_start( $button, $true, $true, 0 );
#$button->show(); $button->show();
$button = new Gtk::Button( "Cancel" );
$button->signal_connect( 'clicked',
sub { destroy $yard_window; } );
$vbox->pack_start( $button, $true, $true, 0 );
$button->show();
$button = new Gtk::Button( "Save" );
$button->signal_connect( 'clicked',
sub { destroy $yard_window; } );
$vbox->pack_start( $button, $true, $true, 0 );
$button->show();
show $yard_window; show $yard_window;

Loading…
Cancel
Save