Re: Widget Overlays



On Wed, 2007-04-11 at 10:47 -0500, Yevgen Muntyan wrote:
> Alexander Larsson wrote:
> > On Wed, 2007-04-11 at 12:09 +0200, Tim Janik wrote:
> >   
> >> On Mon, 9 Apr 2007, Matthew Bucknall wrote:
> >>     
> >
> >   
> >>> I've considered hovering undecorated 'always above' top-level windows
> >>> above my main window, but the icons are not rectangular in shape, so I
> >>> need to deal with transparency (I don't know how), and I also need to
> >>> control their position relative to the main window with pixel precision
> >>> otherwise things are just going to look wonky.
> >>>       
> >> see gtk_widget_shape_combine_mask():
> >>    http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#gtk-widget-shape-combine-mask
> >>     
> >
> > Using a toplevel window seems unnecessary. Why not just make a custom
> > container that has two overlapping child windows, put the overlayed
> > stuff and the shape mask on the upper window and the rest in the lower
> > window.
> >   
> It's not always easy to do if child widgets have windows, you
> have to maintain z-order manually; all code calls
> gdk_window_show() whenever it wants to map. For instance
> if a child window is a notebook, it will raise children on switching
> tabs. And even if you do raise the on-top windows after children
> windows are raised you get nasty blinking.

Not if you use a container. The window order will be this

1 toplevel
  - 2 container
    - 3 overlay subwindow
    - 4 window where container children are put
       - 5 child of container
       - 6 other child of container

Reordering the children of window 4 doesn't affect the z-order of window
3, or its children.



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a short-sighted dishevelled romance novelist looking for a cure to the 
poison coursing through his veins. She's a virginal gypsy bounty hunter with 
only herself to blame. They fight crime! 




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