[java-gnome-hackers] RadioAction and RadioMenuItem coverage
Brought to you by:
afcowie
From: Guillaume M. <res...@gm...> - 2010-02-02 02:56:19
|
Hello, I'm facing some difficulty to add the coverage of RadioAction and RadioMenuItem. As we spoke with Andrew several hours ago, I created a RadioMenuItemGroup to avoid the complexity [and the idiocy] of the GSList* to manage a group of widget. I did it like the existed RadioButtonGroup. Here is an example of how to use my current code: RadioMenuItemGroup group = new RadioMenuItemGroup(); RadioMenuItem item1 = new RadioMenuItem(group, "item1"); ... But I have an error when I try to use this previous piece of code. org.gnome.glib.FatalError: Gtk-CRITICAL gtk_radio_menu_item_new_with_label_from_widget: assertion `GTK_IS_RADIO_MENU_ITEM (group)' failed at org.gnome.gtk.GtkRadioMenuItem.gtk_radio_menu_item_new_with_label_from_widget(Native Method) at org.gnome.gtk.GtkRadioMenuItem.createRadioMenuItemWithLabelFromWidget(GtkRadioMenuItem.java:143) at org.gnome.gtk.RadioMenuItem.<init>(RadioMenuItem.java:76) Into the RadioMenuItem constructor, I call the getMember() method from the RadioMenuItemGroup which returns a RadioMenuItem. But the first call of this method will return *null* because there will be no member in the group. So, I assume that the error is due to that group.getMember() == null. Do you have any idea? Thank you for your advice and your help. -- Guillaume Mazoyer - http://www.respawner.fr/ |