GTK3: enable double click to edit person in descendant browser

svn: r20301
This commit is contained in:
Benny Malengier 2012-08-31 11:06:34 +00:00
parent 43b2d6831a
commit 6a76f51f75
2 changed files with 3 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class DesBrowse(tool.ActivePersonTool, ManagedWindow):
self.tree.append_column(col) self.tree.append_column(col)
self.tree.set_rules_hint(True) self.tree.set_rules_hint(True)
self.tree.set_headers_visible(False) self.tree.set_headers_visible(False)
self.tree.connect('event',self.button_press_event) self.tree.connect('button-press-event', self.button_press_event)
self.make_new_model() self.make_new_model()
self.show() self.show()
@ -120,7 +120,7 @@ class DesBrowse(tool.ActivePersonTool, ManagedWindow):
prev_id = self.add_to_tree(item_id, prev_id, child_ref.ref) prev_id = self.add_to_tree(item_id, prev_id, child_ref.ref)
return item_id return item_id
def button_press_event(self, obj,event): def button_press_event(self, obj, event):
if event.type == Gdk.EventType._2BUTTON_PRESS and event.button == 1: if event.type == Gdk.EventType._2BUTTON_PRESS and event.button == 1:
store, node = self.tree.get_selection().get_selected() store, node = self.tree.get_selection().get_selected()
if node: if node:

View File

@ -37,6 +37,7 @@ from gen.ggettext import gettext as _
# GNOME libraries # GNOME libraries
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gi.repository import Gdk
from gi.repository import Gtk from gi.repository import Gtk
#------------------------------------------------------------------------- #-------------------------------------------------------------------------