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/
-->