mailr26551 - /trunk/gui/components/menu.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on November 12, 2014 - 18:11:
Author: bugman
Date: Wed Nov 12 18:11:28 2014
New Revision: 26551

URL: http://svn.gna.org/viewcvs/relax?rev=26551&view=rev
Log:
Menus created by the gui.components.menu.build_menu_item() now default to the 
wx ID of -1.

This is to conserve wx IDs.  If the calling code does not provide the ID, 
there is no need to grab
one from the small pool of IDs.


Modified:
    trunk/gui/components/menu.py

Modified: trunk/gui/components/menu.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/gui/components/menu.py?rev=26551&r1=26550&r2=26551&view=diff
==============================================================================
--- trunk/gui/components/menu.py        (original)
+++ trunk/gui/components/menu.py        Wed Nov 12 18:11:28 2014
@@ -1,7 +1,7 @@
 
###############################################################################
 #                                                                            
 #
 # Copyright (C) 2009 Michael Bieri                                           
 #
-# Copyright (C) 2010-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2010-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -27,7 +27,7 @@
 import wx
 
 
-def build_menu_item(menu, parent=None, id=None, text='', tooltip='', 
icon=None, fn=None):
+def build_menu_item(menu, parent=None, id=-1, text='', tooltip='', 
icon=None, fn=None):
     """Construct and return the menu sub-item.
 
     @param menu:        The menu object to place this entry in.
@@ -46,10 +46,6 @@
     @rtype:             wx.MenuItem() instance
     """
 
-    # A new ID if necessary.
-    if id == None:
-        id = wx.NewId()
-
     # Initialise the GUI element.
     element = wx.MenuItem(menu, id, text, tooltip)
 




Related Messages


Powered by MHonArc, Updated Wed Nov 12 18:20:02 2014