[Vala] Splash screen test



Hi,
i'm trying Vala/Gtk.

I've written a simple code for a splash screen:

using Gtk;

public class Splash : Gtk.Window{
    /* Costruttore */
    public Splash() {
        new Gtk.Window();
        Grid maingrid = new Gtk.Grid();
        this.add(maingrid);
        maingrid.set_border_width(80);
        Label label = new Gtk.Label("Firefox !!!");
        maingrid.attach(label, 0, 0, 1, 1);
    }
}

public int main(string[] args){
    var win = new Splash();
    win.set_decorated(false);
    win.set_resizable(false);
    win.set_position(Gtk.WindowPosition.CENTER);
    win.show_all();
    Gtk.main();
    return 0;
}

Where I try to execute:
(process:7087): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion
'GDK_IS_SCREEN (screen)' failed

(process:7087): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion
'G_IS_OBJECT (object)' failed

Any idea?

Thanks


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]