GNOME Bugzilla – Bug 635253
GtkRadioButton constructors don't mark group as "allow-none"
Last modified: 2010-11-19 15:32:10 UTC
In the current introspection data, the various gtk_radio_button_new_* constructors take an existing group or widget. These all allow to pass a "None" widget or group list, so that it becomes much easier to build a radio button list in a loop (pass in None the first time, and the previously created button in all other iterations). The "allow-none" is missing, though, so you currently have to work around this with something like b = None for option in my_options: # use previous radio button as group if b: b = Gtk.RadioButton.new_with_label_from_widget(b, option) else: b = Gtk.RadioButton.new_with_label([], option) It should just work with b = None for option in my_options: # use previous radio button as group b = Gtk.RadioButton.new_with_label_from_widget(b, option) but that currently throws TypeError: unbound method new_with_label_from_widget() must be called with RadioButton instance as first argument (got NoneType instance instead)
Created attachment 174830 [details] [review] patch
Whoopsie, seems I accidentally screwed up the severity.
Review of attachment 174830 [details] [review]: If you've tested annotations and are sure that they are correct you can just push them to Gtk+ without opening a bug.
Thanks. I tested it, and some do work now, like Gtk.RadioButton.new_with_label(None, "hello") . Unfortunately some still remain broken (like new_with_label_from_widget()) due to bug 561264, but that's an orthogonal issue. The "allow-none" tags are still correct to have IMHO.