How to place menu bar on frame's title bar and keep "minimize, maximize and close" buttons & and dragging?


Recent softwares like Pycharm has placed the menu bar on the frame’s title bar, so that it saves on the space consumed by title bar. Plus the title bar still has the “minimize, maximize and close” buttons. And the user still can move the window by clicking and dragging the title bar. (I attached an image)

Does anyone know how to do it with wxpython?

You can hide the default title and draw your own using the panel.
An example of moving a window with a custom title (the example is not very good but the essence can be understood).

certainly no copy & paste, but a good start (especially if one hates OO) :angry:
developed would qualify for the Wiki, I think…

if you drag the original frame behind the dialog so that the title bars are on top of each other, release the mouse and drag the dialog then both are dragged: is that a feature? :roll_eyes: (1.1 KB)

Does somebody have a real complete demo - or code that has a menu in the title bar?

From copy & paste (true) , (183.6 KB)
Tested py 3.8.5 / wxPy 4.1.1 / Win10

It’s an amateur job, it’s imperfect, but it works.
You can surely do much better.
Or native source code here.

I hope no one pops up moaning about too many dependencies! and I just wonder if everybody knows what to copy & paste (???) into the own app?

But I suppose I should invest more time into c&p to get the hang of it :upside_down_face:

P.S. I do have to say that this example is much more profound than your last one about the singleton Frame, but you have to admit that the Russian got the dragging part of a modified standard Frame! (for industry most important) quite well (and I think that was all about that post!)