Trigger selection pop-up on Ctrl-Space for Selection Widget of Dict fields

issue3163
review809002
This commit is contained in:
Jean CAVALLO committed 2013-04-24 16:18:50 +02:00
1 parent 6916de398e
commit dd02515f61
1 file changed
+7
@@ -86,6 +86,7 @@ class DictSelectionEntry(DictEntry):
lambda w, e: self.parent_widget._focus_out())
widget.connect('notify::active',
lambda w, e: self.parent_widget._focus_out())
widget.child.connect('key_press_event', self.sig_key_press)
# setting completion and selection
model = gtk.ListStore(gobject.TYPE_STRING)
@@ -129,6 +130,12 @@ class DictSelectionEntry(DictEntry):
def set_readonly(self, readonly):
self.widget.set_sensitive(not readonly)
def sig_key_press(self, widget, event):
if (event.type == gtk.gdk.KEY_PRESS
and event.state & gtk.gdk.CONTROL_MASK
and event.keyval == gtk.keysyms.space):
self.widget.popup()
class DictIntegerEntry(DictEntry):
expand = False