Reviewers: ,


Please review this at http://codereview.tryton.org/210006/

Affected files:
  M tryton/common/cellrendererbinary.py


Index: tryton/common/cellrendererbinary.py
===================================================================

--- a/tryton/common/cellrendererbinary.py
+++ b/tryton/common/cellrendererbinary.py
@@ -68,13 +68,13 @@
     def on_start_editing(self, event, widget, path, background_area,
             cell_area, flags):
         button_width = self.button_width(cell_area)
-        for index, button_name in enumerate(self.buttons):
-            x_offset = button_width * index + 2 * (index + 1)
-            x_button = cell_area.x + x_offset
-            if x_button < event.x < x_button + button_width:
-                break
-        else:
-            button_name = None
+        button_name = None
+        if event is not None:
+            for index, button_name in enumerate(self.buttons):
+                x_offset = button_width * index + 2 * (index + 1)
+                x_button = cell_area.x + x_offset
+                if x_button < event.x < x_button + button_width:
+                    break
         if not self.visible or not button_name:
             return
         if not self.editable and button_name in ('new', 'clear'):



--
[email protected] mailing list

Reply via email to