[wxPython-users] Autocenter dialogs on creation
Jeff Peery
jeffpeery at yahoo.com
Wed Jun 21 06:47:30 PDT 2006
Hi, I use the following in the init method:
#get screen resolution
x = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_X)
y = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y)
#resize frame
self.SetSize((int(x*0.8),int(y*0.8)))
#center frame on screen
self.Centre(wx.BOTH)
"Werner F. Bruhin" <werner.bruhin at free.fr> wrote: Hi Felix,
Felix wrote:
>Hi everyone !!!
>
>everytime i create a wx.Dialog object, to center it I call the dialog.Center() method but:
>it's there anyway to center in on __init__ method ?? something like:
>
> dlg = wx.Dialog(self, parent, -1, pos=wx.CenterPosition)
>
>
Don't know, I do it like this:
dlg = wx.Dialog(self, parent, -1)
diag.CenterOnScreen()
or
diag.Centre(wx.BOTH)
Or as Andrea suggested you just do this in the init method.
Werner
>Thanks
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
>For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20060621/cc117960/attachment.htm
More information about the wxpython-users
mailing list