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



On Sat, 26 Jun 1999, Havoc Pennington wrote:

> 
> 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.
>

Hmmm. yes.  I hadn't done the math.  I've been too busy worrying over the
file size (500K) to think about what was going on in memory.
 
> The GnomeCanvas solves this problem, among other things. I can't imagine
> why you're using the drawing area instead.

Portability.  I want to be able to compile on Windows as well once it gets
to the point that I can compile GTK using cygwin.  I've heard a lot about
the GNOME canvas and really wish I could use it.  This is one of the
things I was talking about when I was suggesting that Owen and co. follow
in the paths of the Qt/KDE folks and move some of the functionality of
gnomelib into GTK.

Alternatively I could hope that someone ports gnome-libs to Win32, but I
suspect that it will be along time before anyone even thinks about doing
that.

 > 
> 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.
>

I'm going to try that as an interim fix.
 
> 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.
>

I guess my best bet for this is to look at the GnomeCanvas source.  I
know that SEGV is also doing something similar in Minion, but he makes
very heavy use of the STL, so I have trouble following his code.  Can you
suggest any documentation that covers such an implementation?

Thanks for your help!

 > Havoc	 > 
> 
>  
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> 

  +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  =   Rob Huffstedtler          |     We now return to our regularly     +
  +   (931) 596-3560            |        scheduled programming           =
  =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+



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