Re: gdk_draw_line

>I created a line using gdk_draw_line(...).
>How can I move it using the mouse ?

First of all, please, please, please, turn off the HTML-formatted mail
option in your email application. You are more than doubling the
bandwidth consumed by your message, and you create messages that are
much hard to read for those people using text email programs.

You can't move a line "directly" with the mouse. You have to erase the
line you drew, and draw it again. I would suggest you take a look at
the source code for a GtkCurve widget, which does this kind of thing.

basically, on a button press event, you grab the pointer, then as you
get motion notify events, you compute the new location of the line,
erase the old one, and redraw the line. when the button release event
arrives, you release the pointer grab, and you're done.


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