Re: top-level window's title bar handling



En/na Ofer Oshri ha escrit:
> well i have tried it before and got core dump...
> here is the code:
> 
> Gtk::Window win;
> Gdk::WMDecoration decor;
> win.get_window()->get_decorations(decor); // core dump...
> btw:
> cerr << bool(win.get_window()) << endl;  // prints 0
> 
> any advice will be appreciated.
> ofer
> 
> */Emil Nowak <emiml wp pl>/* wrote:
> 
>     On 4-10-2007, at 11:19:18 Ofer Oshri wrote:
> 
>     > hi,
>     > i am trying to disable the minimize/maximize/menu icons from the
>     title bar
>     > of a top-level window (keeping only the close icon) with no luck.
>     i thought
>     > the way to do it is through the gdk::window and its method
>     set_decorations()
>     > but i could not access the top_window's gdk::window. is there a way to
>     > disable those icons from the title bar?
>     You can use
>     Glib::RefPtr Gtk::Widget::get_window();
>     on your toplevel Gtk::Window.
> 
>     > also, is there a way to know the
>     > height of the top-level window title bar?
>     probably it is not possible.
> 
>

Hello,

IMO, you should play with the methods of Gtk::Window:

set_decorated(false);
set_deletable(true);

(Check the information page:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Window.html)

Think that in Unix/linux, the decoration are placed by Window Manager,
so depending on which WM are you using, it could or not remove the buttons.

Joaquim Duran



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