Re: [gtk-list] Re: Icon window




Alexey Vyskubov <alexey@pepper.spb.ru> writes:

> > Dockable utilities are window manager specific, AFAIK. 
> 
> No. There is such Xlib thing as an icon window. Window Maker just make use of
> it.
> 
> >GNOME allows you to create applets for their panel, Window Maker has a special type of docking too (when are those guys dropping their own widget set and use GTK+ instead?).
> > 
> > So, it's not a GTK+ feature at all, it depends on your window manager.
> > 
> 
> It's Xlib feature and I would like to know the Right Way to use it
> in GTK application.
> 
> Well, if I program with Xlib I can write something like
> 
> Window mainWindow, myIconWindow;
> Display dpy;
> XWMHints *wm_hints;
> 
> ...
> 
> wm_hints = XAllocWMHints();
> wm_hints->flags = IconWindowHint | StateHint;
> wm_hints->icon_window = myIconWindow;
> wm_hints->initial_state = WithdrawnState;
> 
> XSetWMHints(dpy, mainWindow, wm_hints);

Use the function:

void gdk_window_set_icon        (GdkWindow       *window, 
                                 GdkWindow       *icon_window,
                                 GdkPixmap       *pixmap,
                                 GdkBitmap       *mask);

gdk_window_set_icon (main_window->window, icon_window->window,
                     NULL, NULL);

Note that both the main window and icon window need to be
realized for this to work. Most likely you should make this
callin the "realized" handler for the main window and force
realize the icon window using gtk_widget_realize().

Regards,
                                        Owen



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