I'm pretty new to GUI development, so this question isn't just about wxPython
so much as GUI development in general.
Say that I have a vertical splitter window. On the left, I have tree control
that shows a tree of choices. On the right, I have a panel that shows static
text and text controls related to the object selected in the tree control on
the left. Every time the user clicks on an option in the tree control,
should I basically throw away the previous property panel and create a new
one to take its place? Does anyone have a good sample I could look at that
does something like this? I looked on the Wiki recipes and in the demo, but
I didn't see anything like what I'm asking for.
I'm pretty new to GUI development, so this question isn't just about wxPython
so much as GUI development in general.
Say that I have a vertical splitter window. On the left, I have tree control
that shows a tree of choices. On the right, I have a panel that shows static
text and text controls related to the object selected in the tree control on
the left. Every time the user clicks on an option in the tree control,
should I basically throw away the previous property panel and create a new
one to take its place?
Yes. Or you could pre-create them all and simply show/hide them.
This is actually especially easy with wx.SplitterWindow.
Does anyone have a good sample I could look at that
does something like this? I looked on the Wiki recipes and in the demo, but
I didn't see anything like what I'm asking for.
Not part of the demo, but the demo itself basically does exactly this.
···
On Tue, 19 Oct 2004 12:48:03 -0400, Tom Bryan <tbryan@python.net> wrote:
> Say that I have a vertical splitter window. On the left, I have tree
> control that shows a tree of choices. On the right, I have a panel that
> shows static text and text controls related to the object selected in the
> tree control on the left. Every time the user clicks on an option in the
> tree control, should I basically throw away the previous property panel
> and create a new one to take its place?
Yes. Or you could pre-create them all and simply show/hide them.
This is actually especially easy with wx.SplitterWindow.
Thanks. It's actually a more general problem that I'll probably be hitting
all over my app. Lots of data to edit, but I want to give the user some
sense of his context. I'm still experimenting with various layouts.
> Does anyone have a good sample I could look at
Not part of the demo, but the demo itself basically does exactly this.
Thanks. Good point!
I'm looking at that code now.
---Tom
···
On Tuesday 19 October 2004 01:03 pm, Chris Mellon wrote:
On Tue, 19 Oct 2004 12:48:03 -0400, Tom Bryan <tbryan@python.net> wrote:
well... I think that might not be good for what Tom needs. This is a classical problem solved by MVC.
Have a model that could be interogated about a curent selected item. Then when something is selected in the tree
control change the data in the model and update the panel(s)
I've attached a little script to illustrate how I see Tom's problem solved.
On Tue, 19 Oct 2004 12:03:00 -0500, Chris Mellon <arkanes@gmail.com> wrote:
On Tue, 19 Oct 2004 12:48:03 -0400, Tom Bryan <tbryan@python.net> wrote:
I'm pretty new to GUI development, so this question isn't just about wxPython
so much as GUI development in general.
Say that I have a vertical splitter window. On the left, I have tree control
that shows a tree of choices. On the right, I have a panel that shows static
text and text controls related to the object selected in the tree control on
the left. Every time the user clicks on an option in the tree control,
should I basically throw away the previous property panel and create a new
one to take its place?
Yes. Or you could pre-create them all and simply show/hide them.
This is actually especially easy with wx.SplitterWindow.