Robin,
I am aware that the fault is quite likely with me. I am certainly not
so proud as to be unwilling to except help, and I am very grateful for
all the assistance. My frustration is that I picked this because it's
supposed to be cross-platform, and was quite surprised to find that my
(possibly incorrect) efforts yielded something vastly different on
Windows.
With the exception of the one image, all the buttons that I'm using
are platebuttons - merely text. The type - text or bitmap - doesn't
matter - they either all work (Mac) or none do (Windows).
Here's what I had before (I'll try the WIT tomorrow, as it's late, but
I can give you this much now):
Frame
Sizer
Top Panel
Background
Four Top Platebuttons (Text)
Bottom Panel
Background
One Platebutton (Image)
Side Platebuttons (Text) <-- Show up based on user input
Notebooks
Panels for tabs
Here's what I have now:
Frame
Background
Four Top Platebuttons (Text)
One Platebutton (Image)
Side Platebuttons (Text) <-- Show up based on user input
Notebooks
Panels for tabs
I eliminated the Top Panel, Bottom Panel, and Sizer.
The four top platebuttons stay in view all the time. The one
platebutton that is an image is essentially the "get started" button
at the front and disappears as the first notebook shows up.
The second notebook shows up when the users complete the first. The
third shows up at the end of the second, etc.
Right now, I am simply hiding controls based on program flow. When I
had the sizer, I was also detaching prior to hiding them and re-
attaching prior to showing. (It seems to me that this saves on
memory.) This is easiest to do by creating a list of items to keep,
calling self.frame.GetChildren(), comparing the two, and hiding
anything that's not in the former.
Also, I should note that again, the notebooks do not show up at all in
Windows in either case - how I had the program previously, or how I
have it now. These items are always children of the frame, so unless
a notebook can't be drawn over a background, there's no reason that
that should be the case. Also, it didn't work in the simple app that
I included at 1940 in response to Cody.
Thanks.
···
On Nov 15, 1:24 am, Robin Dunn <ro...@alldunn.com> wrote:
On 11/14/10 9:26 PM, tdahsu wrote:
> > background of the program to work around this for now...
>> It's definitely possible to have working buttons on a panel that is
>> painted with an image--and have it work on Windows. This tutorial by
>> Mike Driscoll may help you figure out what you may need to do:
>>http://www.blog.pythonlibrary.org/2010/03/18/wxpython-putting-a-backg…
>> Che
> Thanks for the tutorial. I've actually been reading more and more of
> Mike's site (finding it very useful) but I hadn't gotten to that part
> yet.
> I've removed the panels from the program entirely.
You probably don't want to do that, depending on the structure of your
UI. The wx.Panel also provides the tab-traversal behavior.
> It occurred to me
> that I didn't really need them (or the sizer, for that matter, which I
> also removed), and have attached everything to the frame (that isn't
> on a notebook tab).
> The background is now a child of the frame, and is all one piece.
> All platebuttons and notebooks have the frame as their parent.
> The platebuttons and notebooks work fine on Mac and Linux.
> The platebuttons not only don't work on Windows now, they don't even
> place properly anymore.
> The notebook still doesn't show up on Windows.
> Whoever said Windows was easier never tried to do this!
We are able to make correctly written programs to work well on each
platform. However we are not able to make incorrectly written programs
to misbehave (if at all) the same way on all the platforms. In other
words, you are certainly doing something wrong that happens to work or
appear to work correctly on Linux and Mac. If you can figure out what
it is then your app can work on all platforms.
You may want to try using the WIT.http://wiki.wxpython.org/Widget_Inspection_Tool It can help you not
only to visualize the hierarchy of the widgets and sizers in the
application, but also to interact with them live via a Python shell.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org