[wxPython-users] saving the state of tree control
Saketh Bhamidipati
saketh.bhamidipati at gmail.com
Mon Oct 9 19:11:07 PDT 2006
On 10/9/06, Thomas Thomas <thomas at eforms.co.nz> wrote:
>
> Hi Josiah,
>
> Thanks for help.. So copying and reassigning back is not option I suppose.
> Why I need a copy is bcz the new state is a filtered down from the actual
> one.
> It more like I have a tree with large set of files/folders and someone
> did a filtering for all the pdfs.
>
> I need to give user option of going back to the all files state. At the
> moment when I do the filtering I delete all the existing items
> add the filtered list of items. A view of the tree in windows explorer is
> similar to what I have..
>
> >All you really need is to know what nodes are expanded and what node is
> >selected. See the IsSelected and IsExpanded functions. From there, you
> >can expand, contract, and select the proper nodes
> This wont work as I am deleteing all items to show the filetered view. And
> when I rebuild the all files state the node pointers gonna be different.
>
>
> Seems like I should display the filtered view in a different control and
> hide the actual one when showing the filtered.
>
> Thanks
> Thomas
>
Try to use the structure of undo/redo events to manage your filtering
system. In this case, you will be dealing with filtering, but the underlying
implementation should be similar.
There is a page on the wxPyWiki which explains how to construct an undo/redo
system for applications, and it shouldn't be too difficult to convert this
to a filter state saving system. If you want to see an example of an
undo/redo system, there are plenty of applications out there which use
wxPython and implement it.
There is no need to create a different control, although you can. For
example, after the user clicks on "Filter PDFs," you filter out the PDFs (
i.e. delete everything PDF). Then, after the user clicks "No filter," you
"undo" the previous filter.
-Saketh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200610=
09/9f1bd062/attachment.htm
More information about the wxpython-users
mailing list