[wxPython] wxFrame and a MenuBar

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] wxFrame and a MenuBar

Nigel Linnett-2
Hi Folks,

   I finally managed to track down one thing thats been bugging me for a
while. Most of the time when I develop a wxPython app it's based on a
wxFrame, and I go ahead and add on the MenuBar and the StatusBar objects,
and things work fine except that pressing (ALT-F) doesn't bring up the file
menu.

   Well, I figured out this morning what I am doing differently than Robin
did in the demo, and now I'm hoping someone can explain to me why it makes
a difference, and how to work-around it.

   I add a wxPanel to the frame after the MenuBar and StatusBar are added.
I do this so that aps based on a simple interface (no need for splitters
and the like) will have a standard look to them. If I don't do this, the
body of the frame looks different, it has a different color (on my system
its noticeably darker) and to my eyes it looks recessed.

   So I guess I need either way to make the wxFrame background colour the
same as the menubar and statusbar, or to make the panel stop interpreting
the keyboard shortcuts.

  If people need to see a small demo app, let me know, should be able to do
one up quickly enough.

Thanks for any help you can give me,

Calishar


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxFrame and a MenuBar

Robin Dunn
>    I add a wxPanel to the frame after the MenuBar and StatusBar are added.
> I do this so that aps based on a simple interface (no need for splitters
> and the like) will have a standard look to them. If I don't do this, the
> body of the frame looks different, it has a different color (on my system
> its noticeably darker) and to my eyes it looks recessed.
>

This is the standard for an empty frame.  There is a system colour reserved
for the client area of frames to help offset the child windows if they don't
totally fill the frame.


>    So I guess I need either way to make the wxFrame background colour the
> same as the menubar and statusbar, or to make the panel stop interpreting
> the keyboard shortcuts.
>

When a wxPanel receives keyboard focus it normally just sets the focus to one
of it's children.  I had though that accelerator keys are supposed to have
already been processed by the time it gets to the panel, though I may be
mistaken on the order.  Regardless, empty panels should not affect things
this way.

Pleas send me a sample and I'll check if it is still doing it in the current
codebase.  Also, I need to know platform and version info for what you are
using.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users