]> git.saurik.com Git - wxWidgets.git/commitdiff
Use EVT_CONTEXT_MENU
authorRobin Dunn <robin@alldunn.com>
Mon, 6 Mar 2006 21:09:46 +0000 (21:09 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 6 Mar 2006 21:09:46 +0000 (21:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/PopupMenu.py

index 45925f22d54df65d601a5f8911054568587fd211..837e9c27d46305bf4885cf9bc8d214f4ee5703e2 100644 (file)
@@ -31,8 +31,6 @@ class TestPanel(wx.Panel):
         t = wx.StaticText(self, -1, "PopupMenu")
         t.SetFont(bf)
         box.Add(t, 0, wx.CENTER|wx.ALL, 5)
         t = wx.StaticText(self, -1, "PopupMenu")
         t.SetFont(bf)
         box.Add(t, 0, wx.CENTER|wx.ALL, 5)
-        self.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
-
 
         box.Add(wx.StaticLine(self, -1), 0, wx.EXPAND)
         box.Add((10,20))
 
         box.Add(wx.StaticLine(self, -1), 0, wx.EXPAND)
         box.Add((10,20))
@@ -40,14 +38,15 @@ class TestPanel(wx.Panel):
         t = wx.StaticText(self, -1, text)
         t.SetFont(nf)
         box.Add(t, 0, wx.CENTER|wx.ALL, 5)
         t = wx.StaticText(self, -1, text)
         t.SetFont(nf)
         box.Add(t, 0, wx.CENTER|wx.ALL, 5)
+        t.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu)
 
         self.SetSizer(box)
 
 
         self.SetSizer(box)
 
-        self.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
+        self.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu)
 
 
 
 
-    def OnRightClick(self, event):
-        self.log.WriteText("OnRightClick\n")
+    def OnContextMenu(self, event):
+        self.log.WriteText("OnContextMenu\n")
 
         # only do this part the first time so the events are only bound once
         #
 
         # only do this part the first time so the events are only bound once
         #