Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Features/GTK3/Porting/Typing Turtle
(view source)
Revision as of 07:13, 27 July 2012
379 bytes added
,
07:13, 27 July 2012
no edit summary
Line 110:
Line 110:
= Code Snippets =
= Code Snippets =
−
== Gtk.TextBuffer =
+
== Gtk.TextBuffer
=
=
self.lessonbuffer = gtk.TextBuffer(self.tagtable)
self.lessonbuffer = gtk.TextBuffer(self.tagtable)
Line 138:
Line 138:
image = Rsvg.Handle.new_from_file(filename)
image = Rsvg.Handle.new_from_file(filename)
−
= Gtk.TextTag =
+
=
= Gtk.TextTag
=
=
instructions_tag = Gtk.TextTag('instructions')
instructions_tag = Gtk.TextTag('instructions')
Line 146:
Line 146:
instructions_tag = Gtk.TextTag.new('instructions')
instructions_tag = Gtk.TextTag.new('instructions')
−
= Gdk.Keymap =
+
=
= Gdk.Keymap
=
=
entries = self.keymap.get_entries_for_keyval(keyval)
entries = self.keymap.get_entries_for_keyval(keyval)
+
for e in entries:
+
e[0], e[1], e[2]
replaced by:
replaced by:
valid, entries = self.keymap.get_entries_for_keyval(keyval)
valid, entries = self.keymap.get_entries_for_keyval(keyval)
+
for e in entries:
+
e.keycode, e.group, e.level
Every entry was a tuple of (keycode, group, level). Now, this is an object with those attributes.
Every entry was a tuple of (keycode, group, level). Now, this is an object with those attributes.
+
+
= Notes =
+
+
* I found this chunk of code in the source (''keyboard.py'' '''L515''') and I didn't understand what it means
+
+
# Hack to get the current modifier state - which will not be represented by the event.
+
state = gtk.gdk.device_get_core_pointer().get_state(self.window)[1]
+
= Useful links =
= Useful links =
Humitos
266
edits