Disabling a submenu

Hello,

I have a menu `File` in which I have a menu `Export`. I want to
disable the `Export` menu, i.e. grey it out. Is this possible? I've
seen that menu items have `Enable(False)` that does this, but the
`Enable` method that menus have requires an id, and I got the
impression it only disables menu items inside the menu.

Is it possible to disable a menu?

Ram.

···

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Yes, you can use Enable with the menu item's Id.

···

On May 2, 3:34 am, cool-RR <ram.rac...@gmail.com> wrote:

Hello,

I have a menu `File` in which I have a menu `Export`. I want to
disable the `Export` menu, i.e. grey it out. Is this possible? I've
seen that menu items have `Enable(False)` that does this, but the
`Enable` method that menus have requires an id, and I got the
impression it only disables menu items inside the menu.

Is it possible to disable a menu?

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Now I have another problem: Is there any way to get the menu’s ID from the object? I mean, I could give it a constant ID when I create it and refer to that, but I’d really like to avoid keeping a static scheme of IDs. I tried GetId, but it seems that wx.Menu doesn’t have it.

Ram.

···

On Sun, May 2, 2010 at 1:40 PM, BigPilot bigpilot@linuxmail.org wrote:

On May 2, 3:34 am, cool-RR ram.rac...@gmail.com wrote:

Hello,

I have a menu File in which I have a menu Export. I want to

disable the Export menu, i.e. grey it out. Is this possible? I’ve

seen that menu items have Enable(False) that does this, but the

Enable method that menus have requires an id, and I got the

impression it only disables menu items inside the menu.

Is it possible to disable a menu?

Yes, you can use Enable with the menu item’s Id.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

cool-RR wrote:

refer to that, but I'd really like to avoid keeping a static scheme of IDs. I tried `GetId`, but it seems that `wx.Menu` doesn't have it.

wx.MenuItem should.

-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@noaa.gov

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Works, thanks.

Ram.

···

On Sun, May 2, 2010 at 9:27 PM, Christopher Barker Chris.Barker@noaa.gov wrote:

cool-RR wrote:

refer to that, but I’d really like to avoid keeping a static scheme of IDs. I tried GetId, but it seems that wx.Menu doesn’t have it.

wx.MenuItem should.

-Chris

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en