[Gtk-sharp-list] Custom Widget Animation Degrades Over Time

Aaron Radich aaron at radich.com
Thu Jul 29 16:09:54 EDT 2010




Thanks for the tips.  I like what you're suggesting with the
Gtk.Window.  Currently my control is based on Gtk.Bin and it contains a
DrawingArea.  What would you suggest I use in order to have the control
contain it's own window that can be scrolled?  Long term I'd like to
create a control that is a Carousel that can be continually spun to the
left or right by clicking and dragging on the control.  For example, it
could be used to show the photos in a photo album.  You could load up 50
photos.  The  control would only show 4 or 5 photos on the controls
visible drawing area at any one time.  You could then spin it to the left
or right in a continuous loop.
Aaron

> On Thu, Jul 29, 2010 at 1:40 PM, Aaron Radich
<aaron at radich.com> wrote:
>> I've created a custom
marquee widget that displays scrolling text and
>> images
similar.  The widget works great when first ran, but over time
>> slows down eventually grinding down to a halt/freeze.  I'm
assuming that
>> there is some sort of resource issue that I am
not managing wisely. 
>> Most
>> of the magic for
the display happens in the DrawingArea's ExposeEvent,
>> which
I am forcing to fire with the DrawingArea.QueueDraw() method call
>> (looping triggered from a GLib.Timeout).  Does anyone see
anything that
>> might be contributing to my performance
>> issue?
> 
> Nothing jumps out immediately - I
suggest you try profiling with
> heap-shot and the statistical
profiler. You're probably leaking
> resources of some kind.
> 
> FWIW you could make the code a fair bit more efficient
by using
> Pixbufs instead of System.Drawing.*.
> 
> If the widget has its own GdkWindow you could call
Gdk.Window.Scroll
> in the timeout to do a more efficient movement
of the contents, then
> have the expose event simply paint the
remaining invalidated region.
> 
> --
> Michael
Hutchinson
> http://mjhutchinson.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20100729/7fcdce61/attachment-0001.html 


More information about the Gtk-sharp-list mailing list