Window (Vala) Tiffany Antopolski tiffany.antopolski@gmail.com 2012 Une fenêtre de niveau supérieur qui peut contenir d'autres éléments graphiques Luc Rebert, traduc@rebert.name 2011 Alain Lojewski, allomervan@gmail.com 2011-2012 Luc Pionchon pionchon.luc@gmail.com 2011 Bruno Brouard annoa.b@gmail.com 2011-12 Luis Menina liberforce@freeside.fr 2014 Fenêtre

L'application Gtk.Application la plus basique

Utilisez Application Window si vous avez besoin de la prise en charge de GMenu.

/* This is the application. */ public class Application : Gtk.Application { /* Constructor */ public Application () { Object (application_id: "org.example.window"); } /* Override the 'activate' signal of GLib.Application, * which is inherited by Gtk.Application. */ public override void activate () { var window = new Gtk.Window (); window.title = "Welcome to GNOME"; /* The following 3 lines are included here to introduce * you to ways you can adjust the toplevel window to suit * your needs. Uncomment them to see what they do. */ //window.border_width = 10; //window.set_default_size (350, 70); //window.window_position = Gtk.WindowPosition.CENTER; /* Add the window to this application. */ this.add_window (window); /* Show the window. */ window.show (); } } /* The main function creates the application and runs it.*/ int main (string[] args) { var app = new Application (); return app.run (args); }

Dans cet exemple, les éléments suivants sont utilisés :

Gtk.Application

Le composant graphique Gtk.Window

L'énumération Gtk.WindowPosition

La méthode set_default_size

border_width

window_position