use Gtk2; use Gtk2::GladeXML; #This loads description of your GUI, from file named #app.glade open (GLADE, "<", $sharedir.$execname.'.glade'); my $gladebuf; while () { $gladebuf .= $_; } close (GLADE); $gladexml = Gtk2::GladeXML->new_from_buffer($gladebuf); # # This way you get the object you want to work on: my $window=$gladexml->get_widget('window'); # There's nothing stopping you from doing this on-the-fly: $gladexml->get_widget('userName')->set_text($userName); ############ sub on_something_something { my $w=$gladexml->get_widget('SomeWidget'); $w->show_all(); $w->run(); $w->hide(); } # Gtk2->main; exit 0;