Re: [gtk-list] slow load bc of drawing area




On Sat, 26 Jun 1999, Rob Huffstedtler wrote:
> I thought that it might be a good idea not to show the window until this
> was all done (thinking that later I might add a splash screen or somethin
> just so the user knows that it is responding).  When I tried that, it
> wouldn't load, because the window attribute of my drawing areas is NULL.
> 
> Does anyone have a suggestion for either getting around this or somehow
> speeding up the load time of my app?
> 

Hang on, you have an 8000x8000 pixmap? 24 bits per pixel times 8K times 8K
= 1536000000 bits = 192000000 bytes = 187500 Kbytes = 183 megabytes. Times
two for the drawing area. Or am I confused? :-) Even if it's only a few
megs, you shouldn't be suprised that this is slow, waste of resources
aside. In fact if it only takes 1 second I suspect you have only an 8 bit
display.

The GnomeCanvas solves this problem, among other things. I can't imagine
why you're using the drawing area instead.

But, if you insist, you can just gtk_widget_realize() the drawing area,
then create your pixmap and draw to it, then gtk_widget_show(). That will
solve the "visible yet frozen" problem.

To speed things up, you'll need to use tricks like the GnomeCanvas does:
basically you need to handle scrolling yourself, so the pixmap and drawing
area are much smaller, and you change what you draw into them as the user
moves the scrollbars.

Havoc	


 








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