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 Kevin Altis other posts by this author
May 7 2002 4:30AM messages near this date
[Pythoncard-users] how to set menu item label? | 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
Thread:
David Primmer
Kevin Altis
David Primmer
Kevin Altis

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