Languages

gtkwidget

Subclassing Gtk.Widget

0
Your rating: None
/*
 * Johan Dahlin 2008
 *
 * A quite simple Gtk.Widget subclass which demonstrates how to subclass
 * and do realizing, sizing and drawing. Based on widget.py in PyGTK
 */ 
 
using Gtk;
using Cairo;
 
public class ValaWidget : Widget {
 
    private static const string TEXT = "Hello World!";
    private static const int BORDER_WIDTH = 10;
    private Pango.Layout layout;
 
    construct {
        this.layout = create_pango_layout (TEXT);
    }
 
    /*
     * This method Gtk+ is calling on a widget to ask
     * the widget how large it wishes to be.
Syndicate content