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

Michael Hutchinson m.j.hutchinson at gmail.com
Thu Jul 29 21:45:27 EDT 2010


On Thu, Jul 29, 2010 at 4:09 PM, Aaron Radich <aaron at radich.com> wrote:
> 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.

Gdk.Window (not to be confused with Gtk.Window) is an underlying GDK
drawable primitive, essentially a sort of a low-level surface. Widgets
need one in order to receive events - but since they consume
resources, some widgets that don't need events, such as Label or
certain containers, do not have one, and instead simply paint on their
parent's Gdk.Window. The GdkWindow property of a widget accesses the
Gdk.Window it uses..

DrawingArea is basically a convenience subclass of Widget that can
(depending on flags) set up a Gdk.Window for itself properly, so you
probably already have one.

The Gdk.Window.Scroll method translates its contents directly on the X
server (i.e. very efficiently) in the amount and direction you
specify, then invalidates the remaining region, so you then get an
Expose event for only the invalidated area.

You might also like to investigate Clutter for your project - a
3d-accelerated scene graph that integrates somewhat with GTK.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Gtk-sharp-list mailing list