aui segfault

I sightly modified the example program Andrea's website. Only thing
added is a toolbar. I get a segfault under Ubuntu 11 / x64 (wx version
2.8.11.0). Can you please confirm that this is a bug? Or maybe I did
something terribly wrong by adding some 5 lines of code?

Another thing I don't understand is that the wxPython demo uses the
"target" paramtere of the AuiManager.AddPane method. But if I try to
use it, I get and error telling:

TypeError: AddPane() got an unexpected keyword argument 'target'

How is that possible?

import wx
import wx.aui

class MyFrame(wx.Frame):

    def __init__(self, parent, id=-1, title="AUI Test",
pos=wx.DefaultPosition,
                 size=(800, 600), style=wx.DEFAULT_FRAME_STYLE):

        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self._mgr = wx.aui.AuiManager()

        # notify AUI which frame to use
        self._mgr.SetManagedWindow(self)

        # create several text controls
        text1 = wx.TextCtrl(self, -1, "Pane 1 - sample text",
                            wx.DefaultPosition, wx.Size(200,150),
                            wx.NO_BORDER | wx.TE_MULTILINE)

        text2 = wx.TextCtrl(self, -1, "Pane 2 - sample text",
                            wx.DefaultPosition, wx.Size(200,150),
                            wx.NO_BORDER | wx.TE_MULTILINE)

        text3 = wx.TextCtrl(self, -1, "Main content window",
                            wx.DefaultPosition, wx.Size(200,150),
                            wx.NO_BORDER | wx.TE_MULTILINE)

        # add the panes to the manager
        tb = wx.aui.AuiToolBar(self, -1, wx.DefaultPosition,
             wx.DefaultSize,
             style=wx.aui.AUI_TB_DEFAULT_STYLE |
wx.aui.AUI_TB_OVERFLOW)
        tb.SetToolBitmapSize(wx.Size(16, 16))
        self._mgr.AddPane(tb, wx.aui.AuiPaneInfo().
            Name("tb").Caption(u"Toolbar").ToolbarPane().Top())

        self._mgr.AddPane(text1,
wx.aui.AuiPaneInfo().Left().Caption("Pane Number One").
            MinimizeButton(True))
        self._mgr.AddPane(text2,
wx.aui.AuiPaneInfo().Bottom().Caption("Pane Number Two"))
        self._mgr.AddPane(text3, wx.aui.AuiPaneInfo().CenterPane())

        # tell the manager to "commit" all the changes just made
        self._mgr.Update()

        self.Bind(wx.EVT_CLOSE, self.OnClose)

    def OnClose(self, event):

        # deinitialize the frame manager
        self._mgr.UnInit()

        self.Destroy()
        event.Skip()

# our normal wxApp-derived class, as usual

app = wx.PySimpleApp()

frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()

app.MainLoop()

Hmm I have noticed another difference. I used "import wx.aui." But the
demo uses "import wx.lib.agw.aui as aui". Changing this single thing
solved the problem. Aren't they the same? Still don't understand why
do I get a segmentation fault?

Hmm I have noticed another difference. I used "import wx.aui." But the
demo uses "import wx.lib.agw.aui as aui". Changing this single thing
solved the problem. Aren't they the same?

No, wx.aui is a wrapper around the C++ implementation of AUI. wx.lib.agw.aui is Andrea's reimplementation of AUI in pure Python code.

Still don't understand why
do I get a segmentation fault?

It could be a bug that Andrea has fixed but the C++ AUI has not.

···

On 7/30/11 3:43 PM, nagylzs wrote:

--
Robin Dunn
Software Craftsman

No, wx.aui is a wrapper around the C++ implementation of AUI.
wx.lib.agw.aui is Andrea's reimplementation of AUI in pure Python code.

> Still don't understand why
> do I get a segmentation fault?

It could be a bug that Andrea has fixed but the C++ AUI has not.

Thank you. I prefer Andrea's now. :smiley:

Good choice. Most people agree with you.

···

On 7/30/11 11:36 PM, nagylzs wrote:

No, wx.aui is a wrapper around the C++ implementation of AUI.
wx.lib.agw.aui is Andrea's reimplementation of AUI in pure Python code.

Still don't understand why
do I get a segmentation fault?

It could be a bug that Andrea has fixed but the C++ AUI has not.

Thank you. I prefer Andrea's now. :smiley:

--
Robin Dunn
Software Craftsman

Hi,

No, wx.aui is a wrapper around the C++ implementation of AUI.
wx.lib.agw.aui is Andrea's reimplementation of AUI in pure Python code.

Still don't understand why
do I get a segmentation fault?

It could be a bug that Andrea has fixed but the C++ AUI has not.

Thank you. I prefer Andrea's now. :smiley:

Good choice. Most people agree with you.

If you are using aui from AGW, I would recommend to get the very
latest version from SVN:

View code:
http://svn.wxwidgets.org/viewvc/wx/wxPython/3rdParty/AGW/agw/

You can download it with this command:
svn co http://svn.wxwidgets.org/svn/wx/wxPython/3rdParty/AGW/ AGW

The aui version on my website is now very old and not maintained anymore.

Andrea.

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

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 31 July 2011 09:18, Robin Dunn wrote:

On 7/30/11 11:36 PM, nagylzs wrote:

I guess I'll have to stick with the version shipped with wxPython. I
want my application be distributed easily. Or is it okay to bundle the
whole svn checkout-ed agw lib with my application? Are there any
dependencies, or is this pure Python?

BTW, thank you for making this library. I'm so grateful! :slight_smile:

   Laszlo

Hi,

I guess I'll have to stick with the version shipped with wxPython. I
want my application be distributed easily. Or is it okay to bundle the
whole svn checkout-ed agw lib with my application? Are there any
dependencies, or is this pure Python?

As far as I can see, there are no particular dependencies for AUI.
It's pure Python, and I believe that, as long as the user has at least
wxPython 2.8.9.X installed, AUI should work without any issue. So,
yes, you can just bundle the whole of AUI in your app and it should
work just fine.

Andrea.

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

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
The Doomed City: Removal Group: the nightmare <==

···

On 31 July 2011 20:26, nagylzs wrote: