Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion sized_control and wx.lib.agw.aui

Received: by 10.236.35.52 with SMTP id t40mr12181811yha.31.1349685360420;
        Mon, 08 Oct 2012 01:36:00 -0700 (PDT)
X-BeenThere: wxpython-users@googlegroups.com
Received: by 10.42.249.136 with SMTP id mk8ls12429040icb.9.gmail; Mon, 08 Oct
 2012 01:35:58 -0700 (PDT)
Received: by 10.42.63.72 with SMTP id b8mr9240819ici.29.1349685358539;
        Mon, 08 Oct 2012 01:35:58 -0700 (PDT)
Received: by 10.42.63.72 with SMTP id b8mr9240818ici.29.1349685358527;
        Mon, 08 Oct 2012 01:35:58 -0700 (PDT)
Return-Path: <werner.bru...@sfr.fr>
Received: from smtp22.services.sfr.fr (smtp22.services.sfr.fr. [93.17.128.13])
        by gmr-mx.google.com with ESMTP id s9si1116994igw.0.2012.10.08.01.35.58;
        Mon, 08 Oct 2012 01:35:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of werner.bru...@sfr.fr designates 93.17.128.13 as permitted sender) client-ip=93.17.128.13;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of werner.bru...@sfr.fr designates 93.17.128.13 as permitted sender) smtp.mail=werner.bru...@sfr.fr
Received: from filter.sfr.fr (localhost [127.0.0.1])
	by msfrf2214.sfr.fr (SMTP Server) with ESMTP id 905C570000AD
	for <wxpython-users@googlegroups.com>; Mon,  8 Oct 2012 10:35:57 +0200 (CEST)
Received: from [192.168.1.47] (230.149.200.77.rev.sfr.net [77.200.149.230])
	by msfrf2214.sfr.fr (SMTP Server) with ESMTP id 3FE847000090
	for <wxpython-users@googlegroups.com>;
	Mon,  8 Oct 2012 10:35:57 +0200 (CEST)
X-SFR-UUID: 20121008083557261.3FE847000...@msfrf2214.sfr.fr
Message-ID: <507290A9.1060502@sfr.fr>
Date: Mon, 08 Oct 2012 10:36:57 +0200
From: Werner <werner.bru...@sfr.fr>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907
	Thunderbird/15.0.1
MIME-Version: 1.0
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] sized_control and wx.lib.agw.aui
References: <5065971B.5000101@sfr.fr>
In-Reply-To: <5065971B.5000101@sfr.fr>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 28/09/2012 14:24, Werner wrote:
> Hi (probably Kevin and/or Andrea;-) ),
>
> I have a layout using aui and the dialog and all panels are 
> sized_control version of these controls, all works well until I try to 
> manually detach/float one of the panels, when I try to do this I get 
> this exception:
>
> dexternalimp.py,  line 1246, in <module>
>   dlg.ShowModal()
> _windows.py,  line 805, in ShowModal
>   return _windows_.Dialog_ShowModal(*args, **kwargs)
> dexternalimp.py,  line 1224, in onImportVintButton
>   self.newWineDialog(self.dbItem, xmlLog)
> dexternalimp.py,  line 1200, in newWineDialog
>   dlg.view.ShowModal()
> _windows.py,  line 805, in ShowModal
>   return _windows_.Dialog_ShowModal(*args, **kwargs)
> framemanager.py,  line 9210, in OnMotion
>   self.OnMotion_ClickCaption(event)
> framemanager.py,  line 9382, in OnMotion_ClickCaption
>   self.Update()
> framemanager.py,  line 6409, in Update
>   frame = self.CreateFloatingFrame(self._frame, p)
> framemanager.py,  line 4237, in CreateFloatingFrame
>   return AuiFloatingFrame(parent, self, pane_info)
> framemanager.py,  line 2887, in __init__
>   size=pane.floating_size, style=style, name="auiFloatingFrame")
> _windows.py,  line 1081, in __init__
>   _windows_.MiniFrame_swiginit(self,_windows_.new_MiniFrame(*args, 
> **kwargs))
> sized_controls.py,  line 617, in AddChild
>   SizedParent.AddChild(self, child)
> sized_controls.py,  line 488, in AddChild
>   item = sizer.Add(child)
>
> self = wx.lib.sized_controls.SizedPanel instance
> child = wx._windows.MiniFrame
>
> A SizedPanel has a sizer, so I don't understand why at this point for 
> some reason the sizer is gone.
>
> Appreciate any tips on what might cause this.
>
> Problem can be recreated by detaching e.g. the lower left panel when 
> running the attached code.
>
Have been digging a bit more on this problem.

In wx.lib.aui.framemanager.py from about line 6226 we have this:

         # delete old sizer first
         self._frame.SetSizer(None)

         # create a layout for all of the panes
         sizer = self.LayoutAll(self._panes, self._docks, self._uiparts, 
False)

If self._frame is a sizedControl this removes its sizer which then 
causes the above error.  self.LayoutAll is creating a new sizer which 
later on will be used for self._frame.SetSizer(sizer) but it is too late 
if control is a sizedControl.

Any tip on how I should go about to come up with a patch for this?

Ideally AUI should leave the sizer(s) managed by SizedControl alone, 
especially as AUI uses a BoxSizer when creating the new sizer which 
might not be what was used in the SizedControl.

Werner