Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Gtk2 '-init'; my $window = Gtk2::Window->new; $window->set_size_request(500,400); $window->set_position('center'); $window->set_title ("Hello world"); $window->signal_connect (destroy => sub { Gtk2->main_quit; }); my $vbox = Gtk2::VBox->new(); $vbox->set("border_width"=> 10); $window->add($vbox); my $label = Gtk2::Label->new("hello world"); $vbox->pack_start($label,0,0,5); # expand?, fill?, padding my $entry = Gtk2::Entry->new(); $vbox->pack_start($entry,0,0,5); my $button = Gtk2::Widget->new("Gtk2::Button", label=>"exit"); $button->signal_connect(clicked=>\&my_quit); $vbox->pack_start($button, 0,0,5); $window->show_all(); Gtk2->main; sub my_quit { print "bye!\n"; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: gtk2 widgets positions
by zentara (Cardinal) on Dec 15, 2009 at 12:50 UTC | |
|
Re: gtk2 widgets positions
by biohisham (Priest) on Dec 15, 2009 at 09:38 UTC | |
|
Re: gtk2 widgets positions
by doug (Pilgrim) on Dec 15, 2009 at 14:42 UTC | |
by zentara (Cardinal) on Dec 15, 2009 at 16:25 UTC |