From: Steve Tuckner Date: 2003-01-28T21:47:29+09:00 Subject: Re: [FXRuby] How to force a paint on a canvas. Thanks to both replies! It works spiffy now and update works fine for my purposes. I guess I looked for and invalidate (Windows/Mac background) method or a repaint method. There was a repaint method but it didn't do any good. What is that for by the way? Thanks again for your help! Steve Tuckner > -----Original Message----- > From: Lyle Johnson [mailto:lyle@users.sourceforge.net] > Sent: Monday, January 27, 2003 6:19 PM > To: ruby-talk@ruby-lang.org > Cc: daniel@zepeda-zone.net > Subject: Re: [FXRuby] How to force a paint on a canvas. > > > Steve Tuckner wrote: > > > I am working on a simple turtle graphics demonstration > program that I > > can use to give a demonstration to several classes of 1st > graders. The > > > problem I am having is that I can draw on the canvas widget, but I > can't > > force it repaint after I draw. The canvas code looks like below: > > > > There's a reasonably good discussion of this in the FOX FAQ: > > http://www.fox-toolkit.org/faq.html > > under the topic "When do I call flush(), forceRefresh(), > refresh() and > update() after a change?". > > As Daniel pointed out in his reply, the function you want to call is > FXCanvas#update, which should mark the drawing canvas as "dirty" and > thus make it a candidate for repainting at some point in the future. > Usually, that time "in the future" arrives pretty quickly (as soon as > you return to the event loop), but it's an important distinction to > note. As the FAQ states, if you want the repaints to take place > *immediately*, be sure to follow the call to FXCanvas#update > with a call > > to FXApp#flush. Since a flush() can be expensive, I'd try it > without it > first to see if you're OK with the delayed results. > > Hope this helps, > > Lyle >