in reply to gtk2 widgets positions

.... i don't know if its the best way..... you may want to use deeply nested hbox's and vbox's , which are created with a size_request....but see how i slide the horses in Gtk2 ....needs thread testing on a multi-threaded computer you use
$widget->set_child_packing ($child, $expand, $fill, $padding, $pack_t +ype)
it's in perldoc Gtk2::Box ...... also check out perldoc Gtk2::Widget..... it has many methods that almost all widgets inherhit ...... the way to search for methods, is read the perldoc, say perldoc Gtk2::Hbox.... at the top of the Hbox docs is the heirarchy tree..... if you don't find the method or signal in the perldoc you opened, keep going up thru the heirarchy and keep looking...... you eventually come to Gtk2::Box

... here is your code, with a nested hbox just to hold the label at pos 50..... you can get very creative with deep nesting of hbox's and vbox's

P.S. you can also use a Gtk2::Table quite imaginatively

#!/usr/bin/perl use warnings; use strict; 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 $hbox1 = Gtk2::HBox->new(); $vbox->pack_start($hbox1,0,0,0); my $label = Gtk2::Label->new("hello world"); $hbox1->pack_start($label,0,0,50); # 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; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku