Re: How ot remove the minimize and maximize button of GtkWindow



On 02/21/2014 01:00 PM, Marco Scannadinari wrote:
On Fri, 2014-02-21 at 09:18 +0100, David Nečas wrote:
On Fri, Feb 21, 2014 at 03:29:07PM +0800, Wiky wrote:
 The default GtkWindow has a minimize , a maximize and a close button in the right or left top coner.
But I want a window which only has a close button. How can I remove the minimize and maximize button?

You can't.  In my window manager the windows may have a completely
different set of buttons.  Or no title bar at all.  Or whatever.  And
the window manager has the last word.

You can override the "decoration-button-layout" style property, but you
need 3.10+ and it will only work in something like GNOME 3 anyway.

The meaningful thing you can do is setting the window type hint with
gdk_window_get_type_hint() (and possibly other hints) to specify what
the window *is* instead, and let the window manager treat it
appropriately and consistently with other widows with the same role.

Yeti


Alternatively, you could create a GtkBox that contains a close GtkButton
and a centred GtkLabel as the title, set it as the titlebar with
gtk_window_set_titlebar(), then connect "clicked" to gtk_main_quit() or
something, though its a very hacky solution, and IDK if it will handle
dragging the window with the mouse.


gtk_window_set_resizable(GTK_WINDOW(your_window) FALSE)

-- 
Emmanuel Thomas-Maurin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]