Ejemplo n.º 1
0
 public void Dispose()
 {
     if (d_surface != null)
     {
         d_surface.Destroy();
     }
 }
Ejemplo n.º 2
0
        // Create a new surface of the appropriate size to store our scribbles
        private void ScribbleConfigure(object o, ConfigureEventArgs args)
        {
            Widget widget = o as Widget;

            if (surface != null)
            {
                surface.Destroy();
            }

            var allocation = widget.Allocation;

            surface = widget.Window.CreateSimilarSurface(Cairo.Content.Color, allocation.Width, allocation.Height);
            var cr = new Cairo.Context(surface);

            cr.SetSourceRGB(1, 1, 1);
            cr.Paint();
            ((IDisposable)cr).Dispose();

            // We've handled the configure event, no need for further processing.
            args.RetVal = true;
        }