public class MyEntry : Gtk.Entry
{
    construct
    {
        get_style_context ().add_class (Gtk.STYLE_CLASS_SPINNER);
        set_state_flags (Gtk.StateFlags.ACTIVE, false);
    }

    public override bool draw (Cairo.Context c)
    {
        c.save ();
        c.push_group ();
        base.draw (c);
        c.pop_group_to_source ();
        c.restore ();

        Gtk.Allocation allocation;
        get_allocation (out allocation);
        int spinner_side = allocation.height / 2;
        int margin = (allocation.height - spinner_side) / 2;

        get_style_context ().render_activity (c, 
                                                allocation.width - spinner_side - margin,
                                                margin,
                                                spinner_side,
                                                spinner_side);

        stdout.printf("draw\n");
        return false;
    }
}

int main(string[] args)
{
    Gtk.init (ref args);

    var window = new Gtk.Window ();
    window.destroy.connect (Gtk.main_quit);
    window.add (new MyEntry ());
    window.show_all ();

    Gtk.main ();
    return 0;
}