Discussion:
Set size of wx.Dialog
Michael Hipp
2006-06-07 17:01:56 UTC
Permalink
I have a class derived from wx.Dialog, nothing I do seems to be able to set the size of the dialog window.

Tried (in the __init__ method):

wx.Dialog__(..., size=(500,500))

self.SetSize((500,500))

self.SetMinSize((500,500))

It always comes out to about 300x300.

Platform: W2kSP4, wxPython 2.6.3.2, Python: 2.4.2

This is bound to be something simple but I just can't see it. Any help?

Thanks,
Michael
Josiah Carlson
2006-06-07 22:02:11 UTC
Permalink
Post by Michael Hipp
I have a class derived from wx.Dialog, nothing I do seems to be able to set the size of the dialog window.
wx.Dialog__(..., size=(500,500))
self.SetSize((500,500))
self.SetMinSize((500,500))
It always comes out to about 300x300.
Platform: W2kSP4, wxPython 2.6.3.2, Python: 2.4.2
This is bound to be something simple but I just can't see it. Any help?
Are you calling SetSizerAndFit() anywhere after any of the sizing calls?

- Josiah
Michael Hipp
2006-06-07 22:12:15 UTC
Permalink
Post by Josiah Carlson
Post by Michael Hipp
I have a class derived from wx.Dialog, nothing I do seems to be able to
set the size of the dialog window.
wx.Dialog__(..., size=(500,500))
self.SetSize((500,500))
self.SetMinSize((500,500))
It always comes out to about 300x300. Platform: W2kSP4, wxPython 2.6.3.2,
Python: 2.4.2
This is bound to be something simple but I just can't see it. Any help?
Are you calling SetSizerAndFit() anywhere after any of the sizing calls?
Yes I am. Or was. I moved the SetSize after it and now the dialog looks huge. Thanks.

I didn't realize that SetSizerAndFit went "up" as well as "down".

Thanks,
Michael
Robin Dunn
2006-06-07 22:19:41 UTC
Permalink
Post by Michael Hipp
Post by Josiah Carlson
Post by Michael Hipp
I have a class derived from wx.Dialog, nothing I do seems to be able to
set the size of the dialog window.
wx.Dialog__(..., size=(500,500))
self.SetSize((500,500))
self.SetMinSize((500,500))
It always comes out to about 300x300. Platform: W2kSP4, wxPython 2.6.3.2,
Python: 2.4.2
This is bound to be something simple but I just can't see it. Any help?
Are you calling SetSizerAndFit() anywhere after any of the sizing calls?
Yes I am. Or was. I moved the SetSize after it and now the dialog looks huge. Thanks.
I didn't realize that SetSizerAndFit went "up" as well as "down".
SetSizerAndFit is essentially the same as this:

self.SetSizer(sizer)
sizer.Fit(self)

So it is resizing self to be the min size requested by the sizer.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Robin Dunn
2006-06-07 22:14:06 UTC
Permalink
Post by Michael Hipp
I have a class derived from wx.Dialog, nothing I do seems to be able to set the size of the dialog window.
wx.Dialog__(..., size=(500,500))
self.SetSize((500,500))
self.SetMinSize((500,500))
It always comes out to about 300x300.
Platform: W2kSP4, wxPython 2.6.3.2, Python: 2.4.2
This is bound to be something simple but I just can't see it. Any help?
It should work, and a quick test here does. Do you use anything that
would modify the size after you've set it, such as using a sizer and
calling its Fit or SetSizeHints?
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Loading...