Re: HELP
- From: Paul Davis <paul linuxaudiosystems com>
- To: Mihai NICULESCU <q quark gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: HELP
- Date: Wed, 01 Aug 2007 10:16:07 -0400
On Mon, 2007-07-30 at 11:07 +0300, Mihai NICULESCU wrote:
> Hi,
>
> I want to make an application which can draw an image, and let the user
> move the image all over the drawing area.
>
> I found in the GTKmm tutorial how to draw an image on a
> GTK::DrawingArea, but couldn't figure it out how to move the image when
> it is selected. I didn't find any signal for the drawing area when the
> cursor moves over it, only *signal_button_press_event()*. And so, I was
> able to capture an event when the mouse clicks on the drawing area, but
> not when it moves.
>
>
> Basically, all I want to do is to display an image, select it and to
> move it with the cursor.
you can't "move" the image other than by redrawing it. so catch motion
notify events, and then call queue_draw() on the drawing area widget. in
the expose handler for the drawing area (where you should be doing all
your drawing anyway), redraw using the (stored) position of the cursor
(from the motion notify event).
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]