Re: Reference other widgets



I could have misunderstood you, but these lines might help you:

# load the user interface
    my $g = new Gtk::GladeXML($uifile);
    $g->signal_autoconnect_from_package('main');
# search for a widget by name (ie for 'my_label', and change it)
    $g->get_widget('my_label)->set_text('Hello world');



On Sat, 19 Jan 2002, Robert Wohlfarth wrote:


I am running a user interface with the Gtk::GladeXML package, version
0.7000. And would like a signal handler to reference another widget.
For  example, a button changing the text of an entry box. Where can I
find a working example of this?

I have tried using $Glade::PerlRun::all_forms. But the signal handler
does not receive any value for $instance...
      sub handler {
              my ($class, $data, $object, $instance) = @_;
              ...
$instance is always blank (zero length).

I did search the list archive. The suggested solution was to keep
a reference to the widgets as the UI is being built. Since Glade
generates the interface, there's no way I know of to save a
reference.

Thanks, in advance.

--
Robert Wohlfarth
rjwohlfar galaxyinternet net

"Is not life more important than food, and the body more
important than clothes?" -- Matthew 6:25b

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


-- 
pozsy




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