ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
Re: [wxpython-users] Newbie question re:wxMenuBar events
by Christopher Barker other posts by this author
May 7 2008 11:57AM messages near this date
Re: [wxpython-users] Newbie question re:wxMenuBar events | [wxpython-users] how to update progress dialog from C routine
Gre7g Luterman wrote:
>  if I were writing this code by hand, each item would look 
>  more like:
>   
>  ID_BUY = wx.NewId()
>  wxglade_tmp_menu.Append(ID_BUY, "Buy CW", "", wx.ITEM_NORMAL)
>  self.Bind(wx.EVT_MENU, self.buy_license, id=ID_BUY)

I'd do:

item = wxglade_tmp_menu.Append(wx.ID_ANY, "Buy CW", "", wx.ITEM_NORMAL)
self.Bind(wx.EVT_MENU, self.buy_license, item)

see:
http://wiki.wxpython.org/wxPython%20Style%20Guide

I really don't like IDs. I do wish you could just do:

Menu_Item.Bind(...)

But such is life.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@[...].gov
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Randy Rue
Chester
Gre7g Luterman
Christopher Barker

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved