Re: draw line in gtk



On Thu, 6 May 2004, Utpal Shasane wrote:
I drawn line using
                                        gdk_draw_line
(draw->window,draw->style->fg_gc[GTK_WIDGET_STATE(draw)],23,20,23,450);
on drawing area widget. But, it comes once and vanishes. When i called
gtk_timeout_add() function it
is contineous. Can somebody tell me, how i can draw a line without using
gtk_timeout_add().
Hi Utpal!
The drawing area widget can't remember your drawing calls, that's why your
line disappears when the drawing area was covered by some other window and
then exposed again. You have to connect the "expose-event" signal to your
drawing area and then draw your contents from the signal handler.
Drawing outside an expose-event can also be dangerous, since the
underlying window resources could be invalid when the widget is
currently not shown on the screen.

Regards,
                     Peter
-- 
====================================================================
Peter Krüger

applied software solutions (appss) GmbH
Sandtorstr. 23
D-39106 Magdeburg
Germany

Phone:  +49-(0)391-54486-19388
Fax:    +49-(0)391-54486-19222
email:  krueger appss de
URL:    http://www.appss.de/

Managing Director: Uwe Hess, Dietmar Schäfer
Register: HRB12386, AG Magdeburg

"Virtual business becomes reality!"

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
====================================================================




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