Gnome GTK: buttons and menus in window title bar

49 views
Skip to first unread message

mbre...@gmail.com

unread,
Mar 4, 2021, 4:37:45 AM3/4/21
to wxPython-users
Dear all

Modern Gnome / GTK applications tend to put buttons and menus into the title bar of the applications windows. Is there a way to deal with this with wxPython?

Thanks for any thoughts and insights!

Tim Roberts

unread,
Mar 4, 2021, 12:34:45 PM3/4/21
to wxpytho...@googlegroups.com
mbre...@gmail.com wrote:
>
> Modern Gnome / GTK applications tend to put buttons and menus into the
> title bar of the applications windows. Is there a way to deal with
> this with wxPython?

When you say "deal with this", do you mean "duplicate this effect"?

That's called the "non-client" area.  This is not always a good idea. 
It's never wise to surprise your users, and it can make it hard to drag
windows around.  You can draw stuff in the non-client area using the
wx.EVT_NC_PAINT event, or you can turn off the title bar and take over
all of the window space as client space.  That means you'll need to
present the minimize/maximize/close buttons yourself.

--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.


Matthias Brennwald

unread,
Mar 5, 2021, 2:29:11 AM3/5/21
to wxpytho...@googlegroups.com

On Thu, Mar 4, 2021 at 09:34, Tim Roberts <ti...@probo.com> wrote:
mbre...@gmail.com wrote:
Modern Gnome / GTK applications tend to put buttons and menus into the title bar of the applications windows. Is there a way to deal with this with wxPython?
When you say "deal with this", do you mean "duplicate this effect"?

Yes, that is sort of what I meant. However, it would be awkward to implement the GUI like this on all platforms, as this is only "a thing" on GNOME / GTK.

Of course I could do something like this:

if platform == GNOME3:
...put widgets in window title bar...
else:
...put widgets in the main area of the window...

However, that's not exactly elegant and misses the idea of wxpython. So what I really meant by "deal with this" was if wxpython has any "mechanism" or if there is a clever approach to place widgets in the window title bar on GNOME, but not on other platforms.

Matthias

Reply all
Reply to author
Forward
0 new messages