pyAUI - restore perspective

When one restores a perspective and it contains a pane which is optional and is not present when doing the LoadPerspective the application hangs.

My work around is to delete the saved perspectives containing the optional pane - in my case no big deal as there are only two panes involved. But potentially this could be a bit of a ??? in the ??? for a user as he would loose his layout just because one pane is no longer needed.

Could LoadPerspective be more forgiving?

Werner

Hi Werner,

2009/10/1 werner:

When one restores a perspective and it contains a pane which is optional
and is not present when doing the LoadPerspective the application hangs.

My work around is to delete the saved perspectives containing the
optional pane - in my case no big deal as there are only two panes
involved. But potentially this could be a bit of a ??? in the ??? for
a user as he would loose his layout just because one pane is no longer
needed.

Could LoadPerspective be more forgiving?

I don't think I understand the problem here: what does "optional"
mean? If it means that the pane can be visible or not, AUI panes
already have Hide() and Show(False) which are respected during
loading/saving perspectives. If you close a pane (unless
DestroyOnClose() is specified), a pane is always there but hidden. If
it hasn't been created before, it can't be in a saved perspective.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Hi Andrea,

Andrea Gavana wrote:

Hi Werner,

2009/10/1 werner:
  

When one restores a perspective and it contains a pane which is optional
and is not present when doing the LoadPerspective the application hangs.

My work around is to delete the saved perspectives containing the
optional pane - in my case no big deal as there are only two panes
involved. But potentially this could be a bit of a ??? in the ??? for
a user as he would loose his layout just because one pane is no longer
needed.

Could LoadPerspective be more forgiving?
    
I don't think I understand the problem here: what does "optional"
mean? If it means that the pane can be visible or not, AUI panes
already have Hide() and Show(False) which are respected during
loading/saving perspectives. If you close a pane (unless
DestroyOnClose() is specified), a pane is always there but hidden. If
it hasn't been created before, it can't be in a saved perspective.
  

By optional I mean there is a user controlled configuration in preferences to show in my case a statistics panel. Now lets assume the user activates this and then saves a perspective, then he changes his mind and de-activates it then on next LoadPersp I have the problem.

Again, don't worry too much about it just for me as I have a solution which is fine, but if others would see a use then it might be something to enhance on.

Werner

When the user changes his mind how is the pane removed?

···

On Oct 1, 9:40 am, werner <wbru...@free.fr> wrote:

Hi Andrea,

Andrea Gavana wrote:
> Hi Werner,

> 2009/10/1 werner:

>> When one restores a perspective and it contains a pane which is optional
>> and is not present when doing the LoadPerspective the application hangs.

>> My work around is to delete the saved perspectives containing the
>> optional pane - in my case no big deal as there are only two panes
>> involved. But potentially this could be a bit of a ??? in the ??? for
>> a user as he would loose his layout just because one pane is no longer
>> needed.

>> Could LoadPerspective be more forgiving?

> I don't think I understand the problem here: what does "optional"
> mean? If it means that the pane can be visible or not, AUI panes
> already have Hide() and Show(False) which are respected during
> loading/saving perspectives. If you close a pane (unless
> DestroyOnClose() is specified), a pane is always there but hidden. If
> it hasn't been created before, it can't be in a saved perspective.

By optional I mean there is a user controlled configuration in
preferences to show in my case a statistics panel. Now lets assume the
user activates this and then saves a perspective, then he changes his
mind and de-activates it then on next LoadPersp I have the problem.

Again, don't worry too much about it just for me as I have a solution
which is fine, but if others would see a use then it might be something
to enhance on.

Werner

Hi Michael,

michael h wrote:

When the user changes his mind how is the pane removed?
  

He goes into preferences and checks a checkbox and not next load of the application the pane is not loaded.

What I do now is when the checkbox state changes I go through the saved perspectives and just remove the entry.

Werner

I think what Andrea was getting at was that you might AddPane that
pane regardless of the user's selection, but check and .Hide() it if
the user doesn't want it in their perspective.

I prefer this method myself as well.. I only use AddPane in my
initialization for the most part

- michael

···

On Oct 2, 2:22 am, werner <wbru...@free.fr> wrote:

Hi Michael,

michael h wrote:
> When the user changes his mind how is the pane removed?

He goes into preferences and checks a checkbox and not next load of the
application the pane is not loaded.

What I do now is when the checkbox state changes I go through the saved
perspectives and just remove the entry.

Werner

Michael,

michael h wrote:

I think what Andrea was getting at was that you might AddPane that
pane regardless of the user's selection, but check and .Hide() it if
the user doesn't want it in their perspective.

I prefer this method myself as well.. I only use AddPane in my
initialization for the most part
  

I didn't want to do this as the pane is a bit slow, it contains a few matplotlib figures and they take a bit to calculate and paint. Calculation and paint is done in an OnIdle event handler.

But having this exchange made me rethink what I do, if I use the hide/show approach I just need to add a check in there if it is hidden in which case I just bypass the calculation etc.

Will give this a go tomorrow.

Thanks
Werner

Hi Michael,

When the user changes his mind how is the pane removed?

I must have missed this one - just chasing a similar issue so looking through all the posts in relation to LoadPerspective.

When the user changes the preference this pane will not be created at all on next load of the application - but it could still be there in a saved perspective.

Werner

···

On 01/10/2009 23:16, michael h wrote:

On Oct 1, 9:40 am, werner<wbru...@free.fr> wrote:

Hi Andrea,

Andrea Gavana wrote:

Hi Werner,
2009/10/1 werner:

When one restores a perspective and it contains a pane which is optional
and is not present when doing the LoadPerspective the application hangs.
My work around is to delete the saved perspectives containing the
optional pane - in my case no big deal as there are only two panes
involved. But potentially this could be a bit of a ??? in the ??? for
a user as he would loose his layout just because one pane is no longer
needed.
Could LoadPerspective be more forgiving?

I don't think I understand the problem here: what does "optional"
mean? If it means that the pane can be visible or not, AUI panes
already have Hide() and Show(False) which are respected during
loading/saving perspectives. If you close a pane (unless
DestroyOnClose() is specified), a pane is always there but hidden. If
it hasn't been created before, it can't be in a saved perspective.

By optional I mean there is a user controlled configuration in
preferences to show in my case a statistics panel. Now lets assume the
user activates this and then saves a perspective, then he changes his
mind and de-activates it then on next LoadPersp I have the problem.

Again, don't worry too much about it just for me as I have a solution
which is fine, but if others would see a use then it might be something
to enhance on.

Werner

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
-~----------~----~----~----~------~----~------~--~---