Hi
i have been fiddling around with the wxPython GUI toolkit for a bit and i wanted one of my programs to start with the window expanded. I googled it but couldn't find an answer there so any help here would be greatly appreciated.

Dani AI

Generated

A few practical pointers that build on and :

For a normal desktop app that should start “expanded” but keep the title bar and taskbar visible, prefer using the frame’s maximize behavior rather than forcing the full-screen pixel size. Full-screen (borderless) mode is useful for kiosks but it removes window decorations and can behave differently across platforms. For multi-monitor setups, query the display that the window will appear on and use that display’s usable/work area rather than the raw resolution so the frame does not cover docks or taskbars.

A couple of small implementation tips: make sure sizers and layout are computed before asking the frame to occupy the screen (so controls get laid out correctly), and use the display/work-area API when targeting a specific monitor. High-DPI displays can make raw pixel counts misleading, so prefer DPI-aware APIs or rely on sizers instead of hard-coded pixel sizes. For authoritative details and platform nuances, see the wx.Frame documentation and the wx.Display/display-area docs: wx.Frame class documentation and wx.Display class documentation.

Recommended Answers

All 4 Replies

Try ...

frame.SetSize((x, y))

# another way, wx.Frame has a ShowFullScreen method
# strips all border decorations and buttons
# (False restores original frame)
myFrame.ShowFullScreen(True, style=wx.FULLSCREEN_ALL)

is there any way using the os or sys modules that you can find the resolution of the screen and then maybe apply it to

frame.SetSize((x,y))

so that way it could run on machines that had different resolutions without looking weird

Use wx.DisplaySize(), it gives width, height tuple of the display screen

yeah thats perfect. Thanks everyone!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.