Re: transparent glass layer over windows



Martin Portman <mrp cre canon co uk> writes:

i want to put a transparent 'glass' frame over a window, to intercept
mouse events, possbily draw on the glass, and pass mouse events on to
what's below the glass.

think of a gesture recogniser, receiving mouse events/signals, drawing
the stroke, but sending key events down, and removing the stroke.

in java i'd use the glassPane part of root panes to do this.

how do i do this using gtk?   

To intercept events you could use a GDK_INPUT_ONLY GdkWindow, which is
invisible. However, there is no particularly good way to implement
drawing on the pane in GTK. (To support it cleanly GTK would need to work
more like Java/Swing or GnomeCanvas, and avoid having any X windows
inside the GTK toplevel window.)

The best hack I can think of is to draw your stroke on the GtkWindow
using GDK_INCLUDE_INFERIORS for the subwindow mode, then to clear the
stroke call gtk_widget_queue_draw() on the whole window. But this will
break if any widget happens to redraw during the stroke.

Havoc




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