hiding control so that keyboard shortcut is disabled?

Hello all,
In my application, I currently use this method to conditionally show controls:

if [some condition]:
ctrl.Hide()
self.Layout() #self is a dialog

However, the alt-letter keystroke associated with that control still
works. For instance, if I hide the "download" button (alt-d), pressing
alt-d would still call the button, hidden or not. My dialog has its
own event handler method, so I could check in there to see if the
control is hidden, but it seems like wx would provide a better way to
hide things so this does not happen. Is there such a thing? TIA.

···

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; http://www.facebook.com/mehgcap

Probably

if [some condition]:
    ctrl.Hide()

    ctrl.Enable(False)

    self.Layout() #self is a dialog

jmf

···

On 9 oct, 06:07, Alex Hall <mehg...@gmail.com> wrote:

Hello all,
In my application, I currently use this method to conditionally show controls:

if [some condition]:
ctrl.Hide()
self.Layout() #self is a dialog

However, the alt-letter keystroke associated with that control still
works. For instance, if I hide the "download" button (alt-d), pressing
alt-d would still call the button, hidden or not. My dialog has its
own event handler method, so I could check in there to see if the
control is hidden, but it seems like wx would provide a better way to
hide things so this does not happen. Is there such a thing? TIA.

ctrl.Hide() and ctrl.Enable(False) are synonymous.

No.

Anyway, .Enable(False) does not do the trick and I really
don't know hou to "skip" this command event.

Test wx.Button, wxPy 2.8.12.1 (msw-ansi), Windows 7.

···

On 9 oct, 13:40, Boštjan Mejak <bostjan.me...@gmail.com> wrote:

ctrl.Hide() and ctrl.Enable(False) are synonymous.

ctrl.Hide() and ctrl.Enable(False) are synonymous.

No.

Anyway, .Enable(False) does not do the trick and I really
don't know hou to "skip" this command event.

Really? It worked perfectly for me. This is python 2.7, wxPython 2.8, win7x64.

···

On 10/9/11, jmfauth <wxjmfauth@gmail.com> wrote:

On 9 oct, 13:40, Boštjan Mejak <bostjan.me...@gmail.com> wrote:

Test wx.Button, wxPy 2.8.12.1 (msw-ansi), Windows 7.

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

--
Have a great day,
Alex (msg sent from GMail website)
mehgcap@gmail.com; Redirecting...

Oops, my bad. After reading the BM's msg, I quickly test with
one of my test application and forgot F1 was also in an
AcceleratotTable in that test app.

jmf

···

On 9 oct, 15:34, Alex Hall <mehg...@gmail.com> wrote:

On 10/9/11, jmfauth <wxjmfa...@gmail.com> wrote:

> On 9 oct, 13:40, Boštjan Mejak <bostjan.me...@gmail.com> wrote:
>> ctrl.Hide() and ctrl.Enable(False) are synonymous.

> No.

> Anyway, .Enable(False) does not do the trick and I really
> don't know hou to "skip" this command event.

Really? It worked perfectly for me. This is python 2.7, wxPython 2.8, win7x64.