Centering a Floating Window

add_node_pane = self._mgr.GetPane(

“add_new_node”).Float().Center().Show()

self._mgr.Update()

I have tried to add a .Center() but it doesn’t center it, inside of the class instantiation I have tried some various settings but no love. Any ideas what I am doing wrong? The pane shows up and works fine, its just not centered.

JS

Hi, I am new in wx.Python. I am digesting somebody else’s code and can’t understand what does wx.ALL do in a sizer.Add statement. Here is a sample code:

buttonSizer.Add( self.incSpin , 0, wx.ALL | wx.ALIGN_CENTER, 1)

Can somebody explain, please? Thanks in advance.

Song

No virus found in this outgoing message.

Checked by AVG Free Edition.

Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release Date: 04/10/2007 8:59 AM

Hi,

From: Song Cao [mailto:scao@ashton-systems.com]
Sent: Friday, October 05, 2007 3:36 PM
To: wxPython-users@lists.wxwidgets.org
Subject: what is the wx.ALL in sizer flag.

Hi, I am new in wx.Python. I am digesting somebody else's
code and can't understand what does wx.ALL do in a sizer.Add
statement. Here is a sample code:

buttonSizer.Add( self.incSpin , 0, wx.ALL | wx.ALIGN_CENTER, 1)

Can somebody explain, please? Thanks in advance.

Song

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release
Date: 04/10/2007 8:59 AM

Basically wx.ALL tells the sizer that it wants x amount of space on all
four sides. In your case, it would have 1 pixel on the left, right, top
and bottom.

# not all of the arguments are required
sizer.Add(someControl/sizer, proportion, flag(s), border)

So if you did this:

buttonSizer.Add( self.incSpin , 0, wx.ALL | wx.ALIGN_CENTER, 5)

it would put five pixels of "space" on all four sides of the widget, as
well as align it to the center.

Hope that helped at least a little bit.

Mike

···

-----Original Message-----

Justin Seitz escribió:

add_node_pane = /self/._mgr.GetPane(/"add_new_node"/).Float().Center().Show()

/self/._mgr.Update()

I have tried to add a .Center() but it doesn't center it, inside of the class instantiation I have tried some various settings but no love. Any ideas what I am doing wrong? The pane shows up and works fine, its just not centered.

JS

try with CenterPane()

What that does is drops the floating pane into the middle of my AUI managed
frame, thus no longer making it a floating pane :frowning: I should have mentioned
that in my first post.

JS

···

-----Original Message-----
From: jonhattan [mailto:jonhattan@faita.net]
Sent: Saturday, October 06, 2007 4:59 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] Centering a Floating Window

Justin Seitz escribió:
>
> add_node_pane =
> /self/._mgr.GetPane(/"add_new_node"/).Float().Center().Show()
>
> /self/._mgr.Update()
>
>
>
> I have tried to add a .Center() but it doesn't center it, inside of
> the class instantiation I have tried some various settings but no
> love. Any ideas what I am doing wrong? The pane shows up and works
> fine, its just not centered.
>
> JS
>
try with CenterPane()

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org

Justin Seitz wrote:

add_node_pane = /self/._mgr.GetPane(/"add_new_node"/).Float().Center().Show()

/self/._mgr.Update()

I have tried to add a .Center() but it doesn't center it, inside of the class instantiation I have tried some various settings but no love. Any ideas what I am doing wrong? The pane shows up and works fine, its just not centered.

Center() just sets the dock_direction member to wxAUI_DOCK_CENTER, so it just affects default docking positions similar to Left(), Right(), Top() and Bottom(). You'll probably need to calculate and set the FloatingPosition yourself instead.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!