Hi,
I've been utilizing wxPython for awhile. But, after looking at the demos in
2.3.3pre4 (which, btw, along with the demo app are a huge help, thanks to
those who write them) I've discovered I was doing some things the hard way.
So, I thought to ask the list how they would accomplish one task that has
been vexing me since the beginning.
I am dragging an ancient DOS based data entry application into 21st century.
The users of this application are very accustomed to its interface and I
wish to duplicate it to the extent posible.
One aspect of the inteface leads the user down a
tree like hierarchy of 'forms'(wxPanels) e.g
at the toplevel there is 1 through 3
user picks '1', which leads to A and B
user picks 'A', which leads to I, II, III , IV
user picks 'I' does some stuff, saves, which puts her back to 'A'
where she can select I, II, III , IV or 'esc' back to '1'
Did I make any sense? Each 'form' takes up the entire client area and can
change the menu and keyboard shortcuts (wxAcceleratorTable).
Basically I would like to maintain a LIFO chain (or stack) of wxPanels(in
wxSizers) with the last/top one visible.
My app is a mainframe with 1 sizer in it.
I first tried just showing and hiding panels but hiden forms still take up
space in sizers (or they did when and how I tried it).
Next, I tried adding / removing panels to / from the sizer. I don't
remember the details but I didn't have much success and gave up on this part
of the project for a couple months.
Then, I decided to add each panel(s) to it's own sizer. I maintain a stack
of sizers and call mymainframe.SetSizer(sizer, deleteOld=false) to keep the
top(of the stack) sizer the one that is displayed. It's a little more
complex as I actually push panels or dialogs which have callbacks in their
destroy() methods to the class that manages the stack. It's that class
which figures out when sizers need to be pushed/poped and show/hiding
forms/dialogs. This worked fairly well until I added some features and it
got funky.
I'm fairly certain I can get the last method to work. But, was wondering if
I was going about it the 'best' way?
thanks,
norm