Re: [gtk-list] Re: Option widget index
- From: "K. M. Hawarden-Ogata" <hawarden duke ifa hawaii edu>
- To: <gtk-list redhat com>
- Subject: Re: [gtk-list] Re: Option widget index
- Date: Wed, 16 Jun 1999 07:37:24 -1000
Unfortunately, I don't want the widget, I want the index of the widget,
i.e., what position in the list the widget holds. The reason I want this is
because I use an array of strings to create the option menu and I need to
know which of the items was selected. But I can't figure out a way to query
the selection. Like I said, getting the widget doesn't help. I know what
position it is in, but the computer doesn't. Is this information not stored
somewhere in the structure?
-----Original Message-----
From: Lee <lee0@callnetuk.com>
To: gtk-list@redhat.com <gtk-list@redhat.com>
Date: Wednesday, June 16, 1999 2:09 AM
Subject: [gtk-list] Re: Option widget index
>K. M. Hawarden-Ogata wrote:
>>
>> For an option menu widget, how do you read off the selected option,
without
>> using a callback?
>
>From browsing the reference documentation, GtkMenu provides the
>following function:
>
>GtkWidget* gtk_menu_get_active (GtkMenu *menu);
>
>So to find which option menu item was just selected, call that function
>using whichever GtkMenu you passed when setting the menu of your
>GtkOptionMenu.
>
>This returns the relevant GtkMenuItem that was selected.
>
>hth,
>
>--
>Lee.
/------------------------------------------------------------------------\
| Miranda Hawarden-Ogata Email: hawarden@irtf.ifa.hawaii.edu |
| NASA IRTF, Institute of Astronomy Phone: (808) 974-4206 |
| 1175 Manono St., Bldg 393 Fax: (808) 974-4207 |
| Hilo, HI 96720 |
\------------------------------------------------------------------------/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]