[wxpython-users] ANN: AUI for wxPython :-D

40 of 41
Andrea Gavana
Hi Werner,
On Mon, Apr 6, 2009 at 3:08 PM, Werner F. Bruhin wrote:
> Hi Andrea,
>
> Andrea Gavana wrote:
>>
>> Hi Werner & All,
>>
>> On Sat, Apr 4, 2009 at 5:05 PM, Werner F. Bruhin wrote:
>>
>>>
>>> As others have expressed I think having perspective saving for
>>> AuiNotebooks
>>> is better then not having it. =A0Maybe just put a "caution" in the
>>> documentation to warn people that they will have to adapt their code wh=
en
>>> a
>>> new/changed/ideal version comes out.
>>>
>>
>> I have uploaded a new version in SVN with the ability of loading and
>> saving AuiNotebook perspectives. The AUI.py demo allows you to play
>> also with AuiNotebook perspectives now.
>>
>> Please let me know if everything works fine.
>>
>
> This works great for me for a notebook which is added using AddPane and
> using the "Name" to find it and save/restore the perspective. =A0This wil=
l
> work great for me as the number of notebooks and the number of pages for
> each of the notebooks are fixed.
>
> I have a notebook on a notebook page, how would I get to the perspective =
for
> that?
>
> See attached my current code - might be helpful for anyone wanting to do =
a
> persistent save using wx.FileConfig. =A0It saves the perspective of the t=
wo
> primary notebooks and restores them.
Please try the attached file. It does what I am expecting it to do,
let me know if it works.
Also, as a side note, if you store the reference of a AuiNotebook like this=
:
self.nb =3D aui.AuiNotebook(...)
...
self.nb2 =3D aui.AuiNotebook(...)
And so on, later on when saving perspectives you don't need to write this:
auibook =3D self._mgr.GetPane("Search").window
self.config.Write(perspName+'/Search', auibook.SavePerspective())
But simply do this (assuming "Search" is self.nb):
self.config.Write(perspName+'/Search', self.nb.SavePerspective())
HTH.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
-->

[wxpython-users] ANN: AUI for wxPython :-D

41 of 41
Werner F. Bruhin
Hi Andrea,
Andrea Gavana wrote:
> Hi Werner,
>
...
> Please try the attached file. It does what I am expecting it to do,
> let me know if it works.
>
You are just to fast!
Works great with one little hick-up. The notebook under vintage has to
be clicked on to show its sub notebook after changing perspectives.
Will do some more experimentation with this tomorrow and let you know if
I can figure out or give you the steps to duplicate.
> Also, as a side note, if you store the reference of a AuiNotebook like this:
>
> self.nb = aui.AuiNotebook(...)
> ...
> self.nb2 = aui.AuiNotebook(...)
>
> And so on, later on when saving perspectives you don't need to write this:
>
> auibook = self._mgr.GetPane("Search").window
> self.config.Write(perspName+'/Search', auibook.SavePerspective())
>
> But simply do this (assuming "Search" is self.nb):
>
> self.config.Write(perspName+'/Search', self.nb.SavePerspective())
>
Should have know this, that what happens when one does some copy and
paste and just makes code to work instead of first thinking and then
pasting :-[ .
Thanks again
Werner
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
-->
Previous 10