how to create a max frame

I try following code, window is display as max, but self.GetSize()
always (400, 250)
I need real max frame, frame display as max and GetSize() as max.

class ImageFrame(wx.Frame):
    """Frame class, main window."""
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Image Change",
size=(-1,-1), style=wx.MAXIMIZE | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER|
wx.MINIMIZE_BOX | wx.CLOSE_BOX)
        print "Create a Frame instance"
        print self.GetSize()

So thank you!

···

--
jiang zhixiang

Have you tried calling self.ShowFullScreen(True) ?

  • Mike

Mike Driscoll:

Have you tried calling self.ShowFullScreen(True) ?

  • Mike

self.ShowFullScreen(True) : show full screen is ok. and self.GetSize() is ok.
I need application start with max window. and self.GetSize()
return max window size.
When is use Maximize(), display as max window but self.GetSize()
return (400, 250).
I need self.GetSize() to calculator widget layout size.

Do your layout in the EVT_SIZE handler instead of in the __init__. There should be an EVT_SIZE when the window is first shown and also when it is maximized (by either method).

···

On 5/14/12 8:40 AM, luckrill wrote:

Mike Driscoll:

    Have you tried calling self.ShowFullScreen(True) ?
    - Mike

self.ShowFullScreen(True) : show full screen is ok. and self.GetSize()
is ok.
I need application start with max window. and self.GetSize() return max
window size.
When is use /Maximize/(), display as max window but self.GetSize()
return (400, 250).
I need self.GetSize() to calculator widget layout
size.

--
Robin Dunn
Software Craftsman

Sounds like you need to switch to using sizers rather than
calculating the widget layout for yourself.

Gadget/Steve
···

wxPython-users+unsubscribe@googlegroups.com
http://groups.google.com/group/wxPython-users?hl=en

start app as max window is OS problem.
void Maximize(Bool maximize)
Maximizes the frame if maximize is TRUE, otherwise restores it (MS
Windows only).

with MS Windows: display as max window and self.GetSize() return value
is max window size.
with linux/GTK: display as max window but self.GetSize() return value
is (400, 250)

Don’t know how to avoid this OS problem.
Next I will try EVT_SIZE handler.