Get custom window .Maximize() to behave correctly

I am editing the custom wxpython frame with a menubar example from the wxPython recipes. What I am having problems with is that when I call, self.Maximize() the window fills the entire screen. How can I get the window to behave like a native one where the frame is sized with the taskbar showing?

Unmaximized

Maximized

Example of what I want the maximized window to do (using the python console as an example)

Below is a .zip of my WIP code

Thanks in advance!

test.zip (45.1 KB)

that’s why I love standard: customer’s ducky :kiss:

Um, could you please clarify what you mean??

well, once you start customizing frames it tends to become a never ending story: I guess the SetMaxSize has to be chosen properly and that will make your frame pretty static, i.e. on Windows 10 the choice of a single or double line task bar may not work anymore (may be that’s why they got rid of it in 11 ???)

That sounds about right. But, I do see custom Qt applications doing what I am trying to achieve so it must be possible somehow in wxPython.

But, I do see custom Qt applications doing what I am trying to achieve so it must be possible somehow in wxPython.

I am not so sure that logic holds up ?

Karsten

Hi, Noah

I’ve posted a very simple quasi :grinning: title bar frame which is made of standard Frame. Try it!

EDIT Don’t forget a patch for Windows

Hi, Noah
Try this script :
test.zip (45.2 KB)

Tested :
Python 3.10.1
wxPython 4.1.2
wxWidgets 3.1.5
Windows 11

Good luck !

luckily Windows 11 has always a fixed size task bar at the bottom: at least one incentive to change… :crossed_fingers:

or if you don’t mind a bit of desktop but for that all mod cons

main_tb.py (26.5 KB)

Thank you @da-dada @komoto48g @Zig_Zag @Karsten_Hilbert for the hints and help. :slightly_smiling_face: The main_tb.py posted above is almost there in terms of what I am looking for. But, of course the desktop is still showing on the sides, which I am sure won’t be desirable for users of the application. (Not to mention that I need that extra screen real-estate :wink:) sigh

Any ideas to fix that? It doesn’t appear that adding more to the max size value does anything.

Hello, Noah
Look at this :
fullScreen.py (5.6 KB)
test.zip (45.2 KB)

2 Likes

Thank you! :smiley: