Re: Regarding gdk_draw_line



>    I am trying to draw lines on a drawing area based on the mouse
>motion event. ie. when the mouse moves on the drawing area, I just
>collect the x and y points and use gdk_draw_line to connect b/w two
>points. I do this till I get button-release event. So, everytime I get 2
>points , I draw a line . But problem I am facing is when I draw a line
>for the current 2 points , the last lines are not getting stored on the
>drawing area. It is getting erased. What should I do to retain the older
>drawn lines also.

X Window and GDK don't work the way you're expecting. There is no "memory" of
what you drew last time. Its up to your application to know how to
redraw the current state of the window at all times. If there are
existing lines/shapes/text to be shown, its up to your application to
remember this and draw them. X/GDK doesn't do this for you.

--p



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