dogtail r372 - in trunk: . sniff



Author: zcerza
Date: Tue Jan 15 20:39:41 2008
New Revision: 372
URL: http://svn.gnome.org/viewvc/dogtail?rev=372&view=rev

Log:
* sniff/sniff: Make rows in the main TreeView expand/collapse on
pressing Enter.


Modified:
   trunk/ChangeLog
   trunk/sniff/sniff

Modified: trunk/sniff/sniff
==============================================================================
--- trunk/sniff/sniff	(original)
+++ trunk/sniff/sniff	Tue Jan 15 20:39:41 2008
@@ -178,6 +178,7 @@
         self.labeleeButton.connect('clicked', self.showRelationTarget, \
                 'labelee')
         self.treeView.connect('button-press-event', self.buttonPress)
+        self.treeView.connect('key-press-event', self.keyPress)
         self.treeView.connect('row-expanded', self.rowExpanded, self.treeModel)
         self.treeView.connect('row-collapsed', self.rowCollapsed)
         self.treeSelection.connect('changed', self.selectionChanged)
@@ -235,6 +236,15 @@
         arg = userParams[1]
         method(arg)
 
+    def keyPress(self, widget, event, *userParams):
+        if event.keyval == gtk.keysyms.Return:
+            path = self.treeSelection.get_selected_rows()[1][0]
+            if self.treeView.row_expanded(path):
+                self.treeView.collapse_row(path)
+            else:
+                self.treeView.expand_row(path, False)
+        return False
+
     def buttonPress(self, widget, event, *userParams):
         try: path, treeViewCol, relX, relY = \
                         self.treeView.get_path_at_pos(int(event.x), \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]