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 >> pythoncard
pythoncard
RE: [Pythoncard-users] how to set menu item label?
by David Primmer other posts by this author
May 9 2002 1:47PM messages near this date
RE: [Pythoncard-users] how to set menu item label? | RE: [Pythoncard-users] how to set menu item label?
Problems with this. Second time through it breaks. If I rename the menu
label I can't find it again with your getMenuId call. If you try to find
that menuitem again it's gone

> >> id = bg.menuBar.getMenuId('menuFileExit')
> >> id
-1

I wrote work-around code to get the menuid once at startup and then I
re-use it but shouldn't this getMenuID call work after the label is
changed?

davep

>  -----Original Message-----
>  From: pythoncard-users-admin@[...].net [mailto:pythoncard-
>  users-admin@[...].net] On Behalf Of Kevin Altis
>  Sent: Monday, May 06, 2002 9:30 PM
>  To: pythoncard-Users
>  Subject: RE: [Pythoncard-users] how to set menu item label?
>  
>  > From: David Primmer
>  >
>  > I'm trying to use self.menuBar.setLabel but apparently it's not
>  > supported. How do I set a menu label other than making my menus
directly
>  > in wxPython?
>  
>  I still need to refactor menu.py so it uses direct subclasses of
>  wxPython's
>  menu classes, so this is a short-term hack. Basically you need the
menu id
>  and then you can just use wxPython. Here's an example done in the
shell
>  with
>  the minimal sample.
>  
>  >>> id = bg.menuBar.getMenuId('menuFileExit')
>  >>> id
>  162
>  >>> mbar = bg.GetMenuBar()
>  >>> mbar.SetLabel(id, 'Goodbye')
>  
>  So, you use getMenuId() with the name of the menu you're interested in
to
>  get its id ('menuFileExit' in the example above) and after that it is
all
>  wxPython methods (GetMenuBar and SetLabel).
>  
>  In your code, you'll use 'self' instead of 'bg'.
>  
>  ka
>  
>  
>  _______________________________________________________________
>  
>  Have big pipes? SourceForge.net is looking for download mirrors. We
supply
>  the hardware. You get the recognition. Email Us:
bandwidth@[...].net
>  _______________________________________________
>  Pythoncard-users mailing list
>  Pythoncard-users@[...].net
>  https://lists.sourceforge.net/lists/listinfo/pythoncard-users


_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@[...].net
_______________________________________________
Pythoncard-users mailing list
Pythoncard-users@[...].net
https://lists.sourceforge.net/lists/listinfo/pythoncard-users
Thread:
David Primmer
Kevin Altis
David Primmer
Kevin Altis

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