Snippet. GTK Minimalistic Window Example

This is a minimalistic GTK example showing a "Hello World" in a window.
using Gtk;

int main(string[] args){
	Gtk.init (ref args);
	Gtk.Window window = new Gtk.Window (Gtk.WindowType.TOPLEVEL);
	Gtk.Label label = new Gtk.Label("Hello world!");
	window.add(label);
    window.set_default_size (300, 200);
    window.show_all ();
	Gtk.main ();
	return 0;
}

Example


Updated on: 21 Nov 2024