Re: SV: SV: drawables.



> > you are drawing in an expose handler, yes?
> > 
> 
> no. :-)
> 
> I do this now.
> 
> 	// retrieving gdk::window to write to
> 	Glib::RefPtr<Gdk::Window> Window =  PolyDrawArea->get_window();
> 	if( !Window )
> 		return; 
> 
> I exit the draw-function if the gdk::window is not visible. It is good
> for performance and it is properbly better programming as well.

i don't know how many times or in what places it has to be written:

	Only attempt to draw to on-screen drawables in an expose handler.

this is an absolute, basic, inviolable rule of all programming with
any GUI toolkit. if you do not draw in the expose handler, then
the contents of the window are at mercy of the underlying window system
(X, Quartz, GDI), and may (or may not) be what you intended. if you draw
in the expose handler and elsewhere, you're just wasting cycles.

so please, repeat after me:

	Only attempt to draw to on-screen drawables in an expose handler.

--p





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