Re: How ot remove the minimize and maximize button of GtkWindow
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 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How ot remove the minimize and maximize button of GtkWindow
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. -- Marco Scannadinari ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
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 ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: How ot remove the minimize and maximize button of GtkWindow
option 1)Create a top level window, then set_decorated to false. You will have no decorations. option 2)There is the XWindow ChangeProperty() that you pass hints for min/max to be false. You could possibly get the XWindow handle from within the GTK api, then call the Xwindow API to get full control that way. The min/max functions are still available but you need to map them to a certain region of your borderless window if you want those events caught. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list