Re: using popup dialog boxes with perl gladexml



Dan Lyke said:
Some quick test code shows me that if you do

    my $dialog = $gladexml->get_widget('fileselectionSaveAs');
    $dialog->show();
    $dialog->run();
    $dialog->destroy();

You cannot then do it again. That widget is gone.

this is a big PITA for GnomeAboutDialogs, because they auto-destroy
themselves; thus they are single-use only from glade.  i recall discussing
this last year.


If $gladexml->get_widget() gave me a new instance of the widget that'd
be great, I could do one parse and one

    $gladexml->signal_autoconnect_from_package(...);

And life would be groovy. So the only time you can use the invisible
trick is for something like a startup dialog, otherwise you've got to
parse again.

another trick, of course, is to use $widget->hide instead of ->destroy.  this
is not possible for the insistently self-destructive GnomeAboutDialog, but
should work for any other.  it also keeps your overhead down, because you're
reusing the widgets rather than recreating them all the time.


-- 
muppet <scott at asofyet dot org>



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