Re: gtk drawing: simple layers



I have a pixmap displayed in a gdk window.  Now I'd
like to superimpose a rectangle to give the user
feedback on the area she has selected with a mouse
drag -- a 'wire frame' rectangle that doesn't cover
up the pixmap.

Hi,

   Uou mean you have a GtkPixmap drawn on a GtkDrawable's
GdkWindow, right?


Any pointers to examples of this sort of thing would
be appreciated. I know it's done in Gimp, but Gimp is
rather complicated; if there's a simpler example
that would be great.

Allin Cottrell
Wake Forest University

M'kay, this is what I would do. Create a GdkGC with the
function set to invert.  Then use this gc to draw a
rectangle on the GdkWindow displaying the graphics.

Speed hint: First draw the rectangle (with the inverse
gc) once to make the rectangle visible, then again at
the exact same location to make it disappear. Now you
can draw the rectangle at the new location, and so on...

--
Sincerely,                  ,"-_                         \|/
-Capt. Taura M.             ,   O=__                    --X--
..__                         ,_JNMNNEO=_                 /|\
OMNOUMmnne.                  {OMMNNNEEEEOO=_
UOOOBIOOOEOMMn.               'LONMMMMNNEEEOOO=.__..,,..
UUOOEUUOOOOOOOObe              '"=OMMMMWNEEEOOOOO,"=OEEEOO=,._
OOUUUIEEIOONNOIUbe.                "7OMMMMNNNNNWWEEEEOOOOOO"   "'.
EEBNNMMMNWNWWEEIMMNe.             __  7EMMMNNNNNWWWEEEEEEEOO.     " .
NNMMMMWWWMMMWEINMMMNn            "=BBEEEEMMMMMMMMNNNWWWEEOOOOO=._     .
                  http://furry.ao.net/~learfox/



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