-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·36 lines (31 loc) · 869 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/gjs
var Application, Gtk, Lang, app;
Lang = imports.lang;
Gtk = imports.gi.Gtk;
Application = new Lang.Class({
Name: "Application",
_init: function() {
this.application = new Gtk.Application();
this.application.connect("activate", Lang.bind(this, this._onActivate));
return this.application.connect("startup", Lang.bind(this, this._onStartup));
},
_buildUI: function() {
this._window = new Gtk.ApplicationWindow({
application: this.application,
title: "Hello World!"
});
this._window.set_default_size(200, 200);
this.label = new Gtk.Label({
label: "Hello World"
});
return this._window.add(this.label);
},
_onActivate: function() {
return this._window.show_all();
},
_onStartup: function() {
return this._buildUI();
}
});
app = new Application();
app.application.run(ARGV);