[pygobject/pygobject-2-28] [gi-demos] keep popup menu from destroying itself by holding a ref in app class



commit bcccff3b2ad9c8054a4d5462c62cde566587eba6
Author: John (J5) Palmieri <johnp redhat com>
Date:   Tue Feb 15 13:26:38 2011 -0500

    [gi-demos] keep popup menu from destroying itself by holding a ref in app class

 demos/gtk-demo/demos/clipboard.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/demos/gtk-demo/demos/clipboard.py b/demos/gtk-demo/demos/clipboard.py
index 74eb0ee..6cfa4a4 100644
--- a/demos/gtk-demo/demos/clipboard.py
+++ b/demos/gtk-demo/demos/clipboard.py
@@ -208,21 +208,21 @@ class ClipboardApp:
         if event.button != 3:
             return False
 
-        menu = Gtk.Menu()
+        self.menu = Gtk.Menu()
 
         #FIXME: default constructor should take a stock property
         item = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_COPY, None)
         item.connect('activate', self.copy_image, data)
         item.show()
-        menu.append(item)
+        self.menu.append(item)
 
         #FIXME: default constructor should take a stock property
         item = Gtk.ImageMenuItem.new_from_stock(Gtk.STOCK_PASTE, None)
         item.connect('activate', self.paste_image, data)
         item.show()
-        menu.append(item)
+        self.menu.append(item)
 
-        menu.popup(None, None, None, None, 3, event.time)
+        self.menu.popup(None, None, None, None, event.button, event.time)
 
 def main(demoapp=None):
     app = ClipboardApp()



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