Re: drawing a line



Hi,
  Thanks for the reply. But I have not really
understood the answer. My doubt is that if Drawing the
line with the timer function does not need any
"expose" event. Then why is pushing_button needing it?
Why can't pushing_button also draw the line without
expose_event?
Thanks.
Shiraz

--- John Cupitt ng-london org uk wrote:
> Shiraz Baig wrote:
> 
>  > Hi,
>  > I want to draw a line when I push a button. I
> have
>  > written the following code. It draws line thru
> two
>  > alternative signal commands.
>  > a. Thru the timer function.
>  > b. Thru the push button.
>  >
>  > It works with the timer function. But it does not
> work
>  > with the push button.
>  >
>  > Question:
>  > Can anyone suggest how can it draw the line when
> I
>  > click the button?
>  >
> 
> 
> Hi, you need to connect to "expose_event" and do
> your repaint there.
> 
> Don't paint on button click. Instead, change your
> model (your internal 
> representation of what it is you are showing on the
> screen), and ask for 
> a repaint to be queued for your window with
> gtk_widget_draw().
> 
> Also, you have a problem with your button callback.
> 
> The scribble example covers some of this stuff:
> 
>
http://www.gtk.org/tutorial/sec-thedrawingareawidget.html
> 
> John
> 
> 
> 
> 
>
==========================================================
> 
> Coming soon: 
> Aelbert Cuyp 13 February - 12 May 2002 
> 
> For information and tickets: 
> http://www.nationalgallery.org.uk


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com



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