RE: draw line in gtk



 
when u set callback to expose event,this callback is
contineously called,which eats cpu time.if set a
pixmap ,it refreshes(expose event is called) only when
somthing  is written on the drawing area.
                                    -manu.

--- Tom Liu <tom liu flextrade com> wrote: > I think
the pixmap will eat more CPU than drawlines.


-----Original Message-----
From: gtk-app-devel-list-admin gnome org
[mailto:gtk-app-devel-list-
admin gnome org] On Behalf Of manu aradhya
Sent: Thursday, May 06, 2004 9:07 AM
To: gtk-app-devel-list gnome org
Subject: Re: draw line in gtk

dont use for the expose event it will take eat
your
system time. better use pixmap to draw. then map
it to
drawing area.see scribble code example.
                               -manu

--- Peter Krueger <pkrueger appss de> wrote: > 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.



====================================================================

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org



http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



________________________________________________________________________
Yahoo! India Matrimony: Find your partner online.
http://yahoo.shaadi.com/india-matrimony/
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org


http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

________________________________________________________________________
Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/



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