wx.aui LoadPerspective() problems

Hi all,
I'd like to ask for help with wx.aui.AuiManager used in a rather complex layout;

Basically, I was quite surprised that the following code seems to work:

        self.Maximize() # self - a frame containing the AuiManager
        self._mgr.LoadPerspective(persp_all) # loads a complex layout
with 25 panes displayed
        self._mgr.LoadPerspective(persp_menu) # displays only a
menu-pane and the centre-pane; all other panels are hidden
        self._mgr.Update()

whereas in the same time, only calling the simpler (2nd) perspective
doesn't work well, the layout remains distorted - not updated.
Would someone have an insight, why the complex perspective can be
loaded rather than the simpler one?
In principle, this is used as a fallback to cover a cornercase, when
the user tries to load a complex layout into a small frame, it should
not matter for normal usage, but I'd like to understand or ideally fix
it nevertheless.

Additionally, I use a check mainly suggested in
http://article.gmane.org/gmane.comp.python.wxpython/55137
on EVT_AUI_RENDER all managed panel sizes of all manager are checked
for a minimal size, and eventually the previous state or a fallback
are loaded.

Unfortunately, I am having difficulty to reproduce this in a simpler
app, it seems to be some kind of timing issue(?) also depending on the
complicated gui, the simpler test layouts don't behave like this.

This is all wx.aui; trying wx.lib.agw.aui I got other problems;
besides speed (looking forward for the announced version!) I cannot
seem to catch the RENDER events, needed for checking the minimal size
or displaying the caption tooltips.

I am using python 2.5.4, wxpython 2.8.10.1 unicode; on windows XP SP3.

Best regards,

     Vlasta

Hi Vlasta,

2009/12/14 Vlastimil Brom:

Hi all,
I'd like to ask for help with wx.aui.AuiManager used in a rather complex layout;

Basically, I was quite surprised that the following code seems to work:

   self\.Maximize\(\) \# self \- a frame containing the AuiManager
   self\.\_mgr\.LoadPerspective\(persp\_all\) \# loads a complex layout

with 25 panes displayed
self._mgr.LoadPerspective(persp_menu) # displays only a
menu-pane and the centre-pane; all other panels are hidden
self._mgr.Update()

whereas in the same time, only calling the simpler (2nd) perspective
doesn't work well, the layout remains distorted - not updated.
Would someone have an insight, why the complex perspective can be
loaded rather than the simpler one?
In principle, this is used as a fallback to cover a cornercase, when
the user tries to load a complex layout into a small frame, it should
not matter for normal usage, but I'd like to understand or ideally fix
it nevertheless.

Difficult to say without a sample app. A couple of things you can try:

1) Check if pane.IsOk() returns True for all your panes when you load
the perspectives;
2) Try this snippet:

self.Maximize()

self.Freeze()

self._mgr.LoadPerspective(persp_all)
self._mgr.Update()

self._mgr.LoadPerspective(persp_menu)
self._mgr.Update()

self.Thaw()

Additionally, I use a check mainly suggested in
http://article.gmane.org/gmane.comp.python.wxpython/55137
on EVT_AUI_RENDER all managed panel sizes of all manager are checked
for a minimal size, and eventually the previous state or a fallback
are loaded.

Unfortunately, I am having difficulty to reproduce this in a simpler
app, it seems to be some kind of timing issue(?) also depending on the
complicated gui, the simpler test layouts don't behave like this.

This is all wx.aui; trying wx.lib.agw.aui I got other problems;
besides speed (looking forward for the announced version!) I cannot
seem to catch the RENDER events, needed for checking the minimal size
or displaying the caption tooltips.

The new version has been out since last Thursday, together with its
revamped documentation here:

http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui

And you can find it in wxPython SVN. It was "announced" in the "AGW
documentation and updates" thread last week. The rendering speed
should now be much improved, although some other small things can be
done to improve it further. If you give it a try let me know if you
find something strange (or if you find a way to speed up things I
overlooked).

Andrea.

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

Hi Vlasta,

2009/12/14 Vlastimil Brom:

Hi all,
I'd like to ask for help with wx.aui.AuiManager used in a rather complex layout;

Basically, I was quite surprised that the following code seems to work:

   self\.Maximize\(\) \# self \- a frame containing the AuiManager
   self\.\_mgr\.LoadPerspective\(persp\_all\) \# loads a complex layout

with 25 panes displayed
self._mgr.LoadPerspective(persp_menu) # displays only a
menu-pane and the centre-pane; all other panels are hidden
self._mgr.Update()

whereas in the same time, only calling the simpler (2nd) perspective
doesn't work well, the layout remains distorted - not updated.

...>

1) Check if pane.IsOk() returns True for all your panes when you load
the perspectives;
2) Try this snippet:

self.Maximize()

self.Freeze()
self._mgr.LoadPerspective(persp_all)
self._mgr.Update()
self._mgr.LoadPerspective(persp_menu)
self._mgr.Update()
self.Thaw()

...>>

This is all wx.aui; trying wx.lib.agw.aui I got other problems;
besides speed (looking forward for the announced version!) I cannot
seem to catch the RENDER events, needed for checking the minimal size
or displaying the caption tooltips.

The new version has been out since last Thursday, together with its
revamped documentation here:

http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui

And you can find it in wxPython SVN. It was "announced" in the "AGW
documentation and updates" thread last week. The rendering speed
should now be much improved, although some other small things can be
done to improve it further. If you give it a try let me know if you
find something strange (or if you find a way to speed up things I
overlooked).

Andrea.

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

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

Hi Andrea, thanks for the suggestions,
unfortunately, the Freeze/Thaw calls don't make any difference (I
already tried some other placements of those)
all((pane.IsOk() for pane in self._mgr.GetAllPanes())) returns True
even on distorted layout
But the strangest for me is, that the above code actually works; I
just have to load the complex perspective first and the wanted simple
one after that (even without the intermediate Update())
I'll have a look whether there aren't any interferences with the
adjacent code ...

Thanks for the info about agw, the new py aui indeed appears to be
much faster than the previous versions.
However, I cannot reasonably test this case with wx.lib.agw.aui; I
need to check the minimum size of the panes' windows (on
EVT_AUI_RENDER, which doesn't seem to do anything in agw aui, is it
expected, or am i overlooking something?)

As a side note, is it possible, that there still remains a possibility
of destructive pane resizing in agw-aui?
In the demo, after loading all panes, one can make the centrePane
smaller (enlarging the neighbour pane); after adding another panes
next to it, the CentrePane gets hidden and other panes in that area
are invalidated; this is the same behaviour like the the original aui.
(cf. attachment)
Is it some immanent limitation of the design, or should it be reported
as a bug somewhere?

greetings,

       Vlasta

···

2009/12/14 Andrea Gavana <andrea.gavana@gmail.com>:

Hi,

2009/12/15 Vlastimil Brom:

Hi Vlasta,

2009/12/14 Vlastimil Brom:

Hi all,
I'd like to ask for help with wx.aui.AuiManager used in a rather complex layout;

Basically, I was quite surprised that the following code seems to work:

   self\.Maximize\(\) \# self \- a frame containing the AuiManager
   self\.\_mgr\.LoadPerspective\(persp\_all\) \# loads a complex layout

with 25 panes displayed
self._mgr.LoadPerspective(persp_menu) # displays only a
menu-pane and the centre-pane; all other panels are hidden
self._mgr.Update()

whereas in the same time, only calling the simpler (2nd) perspective
doesn't work well, the layout remains distorted - not updated.

...>

1) Check if pane.IsOk() returns True for all your panes when you load
the perspectives;
2) Try this snippet:

self.Maximize()

self.Freeze()
self._mgr.LoadPerspective(persp_all)
self._mgr.Update()
self._mgr.LoadPerspective(persp_menu)
self._mgr.Update()
self.Thaw()

...>>

This is all wx.aui; trying wx.lib.agw.aui I got other problems;
besides speed (looking forward for the announced version!) I cannot
seem to catch the RENDER events, needed for checking the minimal size
or displaying the caption tooltips.

The new version has been out since last Thursday, together with its
revamped documentation here:

http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui

And you can find it in wxPython SVN. It was "announced" in the "AGW
documentation and updates" thread last week. The rendering speed
should now be much improved, although some other small things can be
done to improve it further. If you give it a try let me know if you
find something strange (or if you find a way to speed up things I
overlooked).

Andrea.

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

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

Hi Andrea, thanks for the suggestions,
unfortunately, the Freeze/Thaw calls don't make any difference (I
already tried some other placements of those)
all((pane.IsOk() for pane in self._mgr.GetAllPanes())) returns True
even on distorted layout
But the strangest for me is, that the above code actually works; I
just have to load the complex perspective first and the wanted simple
one after that (even without the intermediate Update())
I'll have a look whether there aren't any interferences with the
adjacent code ...

Thanks for the info about agw, the new py aui indeed appears to be
much faster than the previous versions.
However, I cannot reasonably test this case with wx.lib.agw.aui; I
need to check the minimum size of the panes' windows (on
EVT_AUI_RENDER, which doesn't seem to do anything in agw aui, is it
expected, or am i overlooking something?)

It does work for me in the demo, if I do something like this:

self._mgr.Bind(aui.EVT_AUI_RENDER, self.OnRender)

    def OnRender(self, event):

        print "HELLO"
        event.Skip()

This is with the SVN version of agw.aui.

As a side note, is it possible, that there still remains a possibility
of destructive pane resizing in agw-aui?
In the demo, after loading all panes, one can make the centrePane
smaller (enlarging the neighbour pane); after adding another panes
next to it, the CentrePane gets hidden and other panes in that area
are invalidated; this is the same behaviour like the the original aui.
(cf. attachment)
Is it some immanent limitation of the design, or should it be reported
as a bug somewhere?

Try to give a MinSize() to the center pane.

Andrea.

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

···

2009/12/14 Andrea Gavana <andrea.gavana@gmail.com>:

Thanks Andrea,
in my code for the original aui I had the aui events bound to the
managed frame, rather than the manager itself, which seemed to work
there but not in the agw.aui (nor does it raise an exception).
Setting the MinSize indeed worked even on a CentrePane.

thanks again,
   Vlasta

···

2009/12/15 Andrea Gavana <andrea.gavana@gmail.com>:

Hi,

2009/12/15 Vlastimil Brom:

2009/12/14 Andrea Gavana <andrea.gavana@gmail.com>:

Hi Vlasta,

2009/12/14 Vlastimil Brom:

Hi all,
I'd like to ask for help with wx.aui.AuiManager used in a rather complex layout;

Basically, I was quite surprised that the following code seems to work:

   self\.Maximize\(\) \# self \- a frame containing the AuiManager
   self\.\_mgr\.LoadPerspective\(persp\_all\) \# loads a complex layout

with 25 panes displayed
self._mgr.LoadPerspective(persp_menu) # displays only a
menu-pane and the centre-pane; all other panels are hidden
self._mgr.Update()

whereas in the same time, only calling the simpler (2nd) perspective
doesn't work well, the layout remains distorted - not updated.

...>

1) Check if pane.IsOk() returns True for all your panes when you load
the perspectives;
2) Try this snippet:

self.Maximize()

self.Freeze()
self._mgr.LoadPerspective(persp_all)
self._mgr.Update()
self._mgr.LoadPerspective(persp_menu)
self._mgr.Update()
self.Thaw()

...>>

This is all wx.aui; trying wx.lib.agw.aui I got other problems;
besides speed (looking forward for the announced version!) I cannot
seem to catch the RENDER events, needed for checking the minimal size
or displaying the caption tooltips.

The new version has been out since last Thursday, together with its
revamped documentation here:

http://xoomer.virgilio.it/infinity77/AGW_Docs/aui_module.html#aui

And you can find it in wxPython SVN. It was "announced" in the "AGW
documentation and updates" thread last week. The rendering speed
should now be much improved, although some other small things can be
done to improve it further. If you give it a try let me know if you
find something strange (or if you find a way to speed up things I
overlooked).

Andrea.

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

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

Hi Andrea, thanks for the suggestions,
unfortunately, the Freeze/Thaw calls don't make any difference (I
already tried some other placements of those)
all((pane.IsOk() for pane in self._mgr.GetAllPanes())) returns True
even on distorted layout
But the strangest for me is, that the above code actually works; I
just have to load the complex perspective first and the wanted simple
one after that (even without the intermediate Update())
I'll have a look whether there aren't any interferences with the
adjacent code ...

Thanks for the info about agw, the new py aui indeed appears to be
much faster than the previous versions.
However, I cannot reasonably test this case with wx.lib.agw.aui; I
need to check the minimum size of the panes' windows (on
EVT_AUI_RENDER, which doesn't seem to do anything in agw aui, is it
expected, or am i overlooking something?)

It does work for me in the demo, if I do something like this:

self._mgr.Bind(aui.EVT_AUI_RENDER, self.OnRender)

def OnRender(self, event):

   print &quot;HELLO&quot;
   event\.Skip\(\)

This is with the SVN version of agw.aui.

As a side note, is it possible, that there still remains a possibility
of destructive pane resizing in agw-aui?
In the demo, after loading all panes, one can make the centrePane
smaller (enlarging the neighbour pane); after adding another panes
next to it, the CentrePane gets hidden and other panes in that area
are invalidated; this is the same behaviour like the the original aui.
(cf. attachment)
Is it some immanent limitation of the design, or should it be reported
as a bug somewhere?

Try to give a MinSize() to the center pane.

Andrea.

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

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