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