RE: Access information of an optionsmenu
- From: martyn 2 russell bt com
- To: gtk-app-devel-list gnome org
- Subject: RE: Access information of an optionsmenu
- Date: Tue, 9 Apr 2002 10:06:10 +0100
Yea, I had this problem. The way I did it, was to use gtk_object_set_data
for each menuitem and then when it was clicked I could use
gtk_object_get_data to find out which one had been clicked.
I also created the menu programmatically, which meant I could set up the
"clicked" event to a particular function, this function comes with the
parameters (GtkMenuItem *menuitem, gpointer user_data), I assigned the data
to the menuitem, therefore, I had a function which was called when the item
was clicked and I assigned data to know which item had been clicked.
To find out which option is currently displayed, that's a little harder, you
might want to try using the GtkButton of the GtkOptionMenu (shown below):
GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBin
+----GtkButton
+----GtkOptionMenu
- I think I tried this but was unsuccessful. If you are interested in the
index, I don't know that you can?
Regards,
Martyn
-----Original Message-----
From: Norbert Haefke Freudenberg de
[mailto:Norbert Haefke Freudenberg de]
Sent: Tuesday, April 09, 2002 8:18 AM
To: gtk-app-devel-list gnome org
Subject: Access information of an optionsmenu
Hi
Question about the option menu:
I need to figure out wich option was choosen from the user.
I dont wont to use callbacks for this.
Is there any function (or way) to get information
from the optionmenu which option is currently displayed.
Thanks for help
Norbert
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]