Re: MenuItem label text

On 03/06/01 Francois BARRIERE wrote:
   I'm using Gtk-PERL with Glade and try to retrieve the label (or item
position in the list) of an optionMenu. The code being written by Glade
there is no callback connected to the optionMenu change, and I can't add one,
so I would like to get the selected item label (or anything more than just the
MenuItem widget reference).
Until now I can get to the selected item (with ->get_menu->get_active), but
I'm stuck here!

Can someone give me a clue?

Once you have the active menu item you get the child widget with:
$child = $menuitem->child;

If the child is a Gtk::Label, you can simply use:
$text = $child->get;

to get the text in the label.


lupus debian org                                     debian/rules
lupus ximian com                             Monkeys do it better

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