I'm creating a widget in Gtk# which contains a Drawing area.  When an
expose event occurs I create a Cairo context from the Gdk Window of the
drawing area and I draw on it.  It is working well, but the Expose event
seems to fire *CONSTANTLY* so the Widget just sits there soaking up
nearly an entire core.  The window isn't being moved or resized and
nothing is passing over the widget.  Am I missing something?

Possibly the issue is because the drawing area is scrollable? (Even
though it isn't being scrolled).

The expose even of the drawing area is linked to -
protected virtual void OnAreaExposeEvent (object o, Gtk.ExposeEventArgs
args)
    {
      Draw ();
    }

And Draw just creates the Cairo context and draws on it.


public void Draw ()
{
  ....
  Console.WriteLine("Draw: (width={0},height={0})", width, height);   
  cairo = Gdk.CairoHelper.Create (area.GdkWindow);
  ...
  ...
  ((IDisposable) cairo.Target).Dispose();
  (IDisposable) cairo).Dispose ();
}

I see the "Draw: ... " message non-stop.

This is the first time I've used DrawingArea or Cairo as I'm not a
graphics guy at all,  but I really need a weekview calendar widget for
Gtk# and none seem to be available.   So far Cairo seems very nice to
use, and fast;  I've been able to draw hour lines and day columns,
etc...  but the documentation on some of the gritty details is rather
sparse.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to