PyAUI

Hello,

I am using PyAUI and have run into a problem now. Basically I want a layout with a pane on the left and two panes on the right stacked on top of each other. There shouldn't be any space between the left and right panes.
So I tried creating a layout without a center pane at all. This doesn't work. Judging from the PyAUI source code, it creates an empty center pane itself. My next try was to create an empty panel and use this as the center pane, with an additional MaxSize(1,1). That didn't work out, the whole frame was shrunk to 0 size.
I also tried to create one pane as left and two center ones. That looks alright, but you can't the center panes around (you could do that with Right() panes).

How can I achieve the behaviour I want?

-Matthias

Hello Matthias,

So I tried creating a layout without a center pane at all. This doesn't
work. Judging from the PyAUI source code, it creates an empty center pane
itself. My next try was to create an empty panel and use this as the
center pane, with an additional MaxSize(1,1). That didn't work out, the
whole frame was shrunk to 0 size.

As you probably know, now that wxAUI has been integrated into
wxPython, PyAUI is dead at 95%. So I would suggest you to switch to
wx.lib.aui as soon as you get wxPython 2.7 installed. It is much more
stable, though less featured than PyAUI development version.
However, if you are still using PyAUI, I would suggest you something like that:

        self._mgr = PyAUI.FrameManager()
        self._mgr.SetFrame(self)

        self._mgr.AddPane(MyLeftPane, PyAUI.PaneInfo().Left().Layer(1))
        self._mgr.AddPane(MyTopCenterPane, PyAUI.PaneInfo().Center())
        self._mgr.AddPane(MyBottomCenterPane, PyAUI.PaneInfo().Bottom())

        self._mgr.Update()

Notice the use of Left() and Layer(1) for the left pane. The Layer()
method simply tells PyAUI that the left pane should occupy all the
frame height without giving space to the other two panes, that result
in being stacked one over the other. One of the two is a CenterPane(),
so you may want to play with the MinSize() and BestSize() for the
bottompane to adjust it a little bit. If you want to keep the right
panes always with the same proportions (almost), you can try to play
with the Proportion values in PyAUI, although it is not very easy to
achieve this behavior.

I hope I correctly understood your problem.

Andrea.

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

I've switched over to wx.aui some days ago. Basically I do a

try:
     import wx.aui as AUI
except:
     import PyAUI as AUI

to ensure my app runs on wx < 2.7. When using wx.aui I also got rid of that mysterious crash when undocking a pane which we talked about sometime before.
My current approach is the same as what you suggested above, basically relying on the MinSize() things. I tried to use the Layer() approach, too, but for some reason it did not work out. I will try the way you suggest next.
Personally I like it a lot that I can read the PyAUI source code easily. It's much easier than to delve through a bunch of c++ files. So PyAUI is still a great help even when dealing with wx.aui.
Another smaller thing I noticed is about the position hints when you want to dock a floating pane. Of course you can dock them to top, left, bottom and right. If you have already a pane at the top you can dock a new pane right beside it (so you have two top panels side-by-side). You can also dock a new panel above the old top panel instead of docking it side-by-side (it looks like two rows on top of each other, with the new one topmost). But you cannot dock the new panel in such a way that you get two rows on top of each other, with the new one lower than the old one. I think programatically this is like creating a new row and making the old panel Row(0) and the new one Row(1). This happens in wx.aui and in PyAUI. Is this by intentention or a bug/missing feature? It would be quite useful.
Something I am also wondering with respect to wx.aui is how it interacts with the new extendo control. I tried putting an extendo into a pane and it behaved a bit strange. Also bound the ETC_LAYOUT event to a function which calls _mgr.Update() which seems to interact with this. Are both of them supposed to get along?

Thanks for your answer,

-Matthias

ยทยทยท

Am 27.09.2006, 21:54 Uhr, schrieb Andrea Gavana <andrea.gavana@gmail.com>:

Hello Matthias,

So I tried creating a layout without a center pane at all. This doesn't
work. Judging from the PyAUI source code, it creates an empty center pane
itself. My next try was to create an empty panel and use this as the
center pane, with an additional MaxSize(1,1). That didn't work out, the
whole frame was shrunk to 0 size.

As you probably know, now that wxAUI has been integrated into
wxPython, PyAUI is dead at 95%. So I would suggest you to switch to
wx.lib.aui as soon as you get wxPython 2.7 installed. It is much more
stable, though less featured than PyAUI development version.
However, if you are still using PyAUI, I would suggest you something like that:

        self._mgr = PyAUI.FrameManager()
        self._mgr.SetFrame(self)

        self._mgr.AddPane(MyLeftPane, PyAUI.PaneInfo().Left().Layer(1))
        self._mgr.AddPane(MyTopCenterPane, PyAUI.PaneInfo().Center())
        self._mgr.AddPane(MyBottomCenterPane, PyAUI.PaneInfo().Bottom())

        self._mgr.Update()

Notice the use of Left() and Layer(1) for the left pane. The Layer()
method simply tells PyAUI that the left pane should occupy all the
frame height without giving space to the other two panes, that result
in being stacked one over the other. One of the two is a CenterPane(),
so you may want to play with the MinSize() and BestSize() for the
bottompane to adjust it a little bit. If you want to keep the right
panes always with the same proportions (almost), you can try to play
with the Proportion values in PyAUI, although it is not very easy to
achieve this behavior.

I hope I correctly understood your problem.