Re: gtk-app-devel-list Digest, Vol 9, Issue 16




Jody Goldberg <jody gnome org> writes:

On Sat, Jan 08, 2005 at 11:26:45PM +0000, Roger Leigh wrote:

I'd like to let the mouse wheel and Alt + mouse wheel scroll
horizontally and vertically when over any of the canvas widgets.

With Gtk2 this is nice and clean, not like gtk1 where you had to
look for buttons 4&5.

Just put a handler for "scroll-event" onto the window.
Have a look at
gnumeric/src/workbook-control-gui.c:wbcg_scroll_wheel_support_cb
for an example.

That works fairly straightforwardly.  I can now scroll and zoom
nicely.  The only problem is the slowness of zooming: I have to signal
all my "CanvasCell" objects to re-set the "font-desc" property; this
turns out to be quite expensive with as few as 256 cells.


This is due to pango's HORRIBLY slow performance.  I got hit by this in my
code. I was updating a simple group of GTK labels at an accelerated rate (10-20
times/sec) resulted in over 40% CPU usage for a Dual Athlon 1200  system, which
I found completely unacceptable, unfortunately my pango bugreport was
completely ignored.  If pango could CACHE things internally (sizes in pixels of
screen space required per char per font size, it wouldn't need to rerender
things nearly as often.  Keep things like a pre-rendered glyph cache, so all
that needs to be done is copy's when text changes  the penalty is higher memory
overhead,  but I'd take that over it's currently horrible cpu penalizing
method.

 

=====
Dave J. Andruczyk


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250



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