Re: using popup dialog boxes with perl gladexml



On Thu, Apr 08, 2004 at 06:41:55 -0500, B McAndrews wrote:
Let me answer my own question, in the hope that someone else may benefit :)

I was not specifying the specific node to retrieve when calling 
GladeXML->new
ie,
my $gladexml = Gtk2::GladeXML->new('myglade.glade');
my $login = $gladexml->get_widget('mydialog');
$login->show();

The correct answer to your question is, that libglade already did this
for all the widgets it created. Unless you told it not to do it by
checking off the "visible" button in glade object inspector.

$login->run();
so subsequently, it displayed both my dialog and window.

Getting the specific node enabled me to just get the dialog box:

my $gladexml = Gtk2::GladeXML->new('myglade.glade','mydialog');
my $login = $gladexml->get_widget('mydialog');
$login->show();
$login->run();
#verify login
...
$login->destroy();

# now get the main window
$gladexml = Gtk2::GladeXML->new('myglade.glade','window1');

Except that now you parse the whole xml file twice.

...
Gtk2->main
-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec <bulb ucw cz>

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]