Reputation: 19989
I'd like to rewrite a gtk python library to Gtk3 (gi.repository) I'd like to ask you what does it include?
For instance library contained contructions like this
gtk.gdk.Cursor(gtk.gdk.TOP_LEFT_CORNER),
gtk.gdk.Cursor(gtk.gdk.TOP_RIGHT_CORNER),
gtk.gdk.Cursor(gtk.gdk.BOTTOM_RIGHT_CORNER),
gtk.gdk.Cursor(gtk.gdk.BOTTOM_LEFT_CORNER) )
so I rewrote it to this
Gdk.Cursor(Gdk.CursorType.TOP_LEFT_CORNER),
Gdk.Cursor(Gdk.CursorType.TOP_RIGHT_CORNER),
Gdk.Cursor(Gdk.CursorType.BOTTOM_RIGHT_CORNER),
Gdk.Cursor(Gdk.CursorType.BOTTOM_LEFT_CORNER) )
So basically what I did was that I opened ipython and google, and was guessing :/
My questions:
gtk.CAN_FOCUS
, but I have no idea where do I find such constant in gi.repository
Can somebody please explain, why was this change done? gtk2->gtk3, why just not upgrade old libraries? And what does it include if I want to rewrite app for gtk3?
Upvotes: 0
Views: 709
Reputation: 379
For anyone who finds this in the future you can set this flag with this property.
drawing_area.set_property('can-focus', True)
Upvotes: 1
Reputation: 77454
Try this in interactive Python:
from gi.repository import Gtk
dir(Gtk)
Upvotes: 0