GNOME Bugzilla – Bug 622584
Pygi doesn't allow to convert and int to an enum
Last modified: 2010-07-26 11:57:57 UTC
See this code in pygtk: In pygtk this works, but in pygi it doesn't as view.set_smart_home_end(current.get_current_value()) would produce an error. import gtk import gtksourceview2 as gsv view = gsv.View() def smart(action, current): view.set_smart_home_end(current.get_current_value()) print current.get_current_value() action_group = gtk.ActionGroup("blah") action_group.add_radio_actions([("Blah", None, "Disabled", None, "blah", 1), ("Blah2", None, "Disabled2", None, "blah2", 2)],-1, smart, "hello") for action in action_group.list_actions(): print action.get_name() action.activate() gtk.main()
Created attachment 165463 [details] [review] Allow passing ints as enum args
(In reply to comment #1) > Created an attachment (id=165463) [details] [review] > Allow passing ints as enum args Is this what you want? Can you confirm this behavior matches pygtk's?
This patch seems to work for the problem I had with gtksourceview.
Attachment 165463 [details] pushed as 5ca2a41 - Allow passing ints as enum args