SV: SV: SV: drawables.



> -----Oprindelig meddelelse-----
> Fra: Paul Davis [mailto:paul linuxaudiosystems com]
> Sendt: 26. juni 2006 16:40
> Til: Morten Bo Nielsen
> Cc: gtkmm-list gnome org
> Emne: 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
> 

ok
	Only attempt to draw to on-screen drawables in an expose handler
(and I will properly remember this from now on.)

I'm fairly new to GUI and gtk programming and I have had a hard time
getting an overview of it all. I have always prefered the simplicity of
concole programming.

The gtk tutorial (from
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/index.html) is
good reading, and gives the basics on gtkmm programming - based  on the
examples, I can extrapolate using the documentation of the different
widgets. But, as should be obvious, I have a hard time distinguishing
between gdk, glib, atk, pango, etc. and most of the examples I find
using google is pure C that doesn't translate easily to C++.

Do you have links to other good documentation? (beside gtkmm.org)

morten



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