[ale] Gtk-Perl

Eric Anderson eric.anderson at cordata.net
Thu Nov 7 15:42:32 EST 2002


I'm writing a stupid little app to keep track of what bills I have due,
when they are do, how much they are, etc.

Got most of it done, but I have run into a snag that I can't figure out.
I am writing this in Perl using Gtk+ as the interface. I have a drop
down menu which I want to grab the value of the selected item and stick
it in a variable.

So I have a reference to the GtkOptionMenu. So it should be as easy as
something like this

$dropdown->get_menu()->get_active()->child()->get();

This will tell it to grab the menu from the GtkOptionMenu object, then
get the active GtkMenuItem from the GtkMenu, then get the child of
GtkMenuItem which should be a GtkLabel, then get the text of the label.

The problem is that child() returns undef. So

$dropdown->get_menu()->get_active()

will get me a GtkMenuItem, but I can't get the value from there because
child() return undef.

Any suggestions?

-- 
Eric Anderson

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list