4Xs9DD9BFQIY45cZRzygrB changeset

Changeset623738393433 (b)
ParentNone (a)
ab
0+# GObject Introspection APIs are available from imports.gi.Modulename
0+Gtk = imports.gi.Gtk
0+
0+# JavaScript imports happen via imports.filename, where filename.js
0+# is assumed to be available in module/ folder
0+
0+Gtk.init 0, null
0+
0+win = new Gtk.Window
0+    type: Gtk.WindowType.TOPLEVEL
0+win.set_border_width 10
0+
0+win.connect "destroy", (widget) ->
0+    Gtk.main_quit()
0+
0+button = new Gtk.Button
0+    label: "Hello, world"
0+
0+button.connect "clicked", ->
0+    button.set_label "Bar"
0+
0+win.add button
0+button.show()
0+win.show()
0+
0+Gtk.main()
...
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
--- Revision None
+++ Revision 623738393433
@@ -0,0 +1,26 @@
+# GObject Introspection APIs are available from imports.gi.Modulename
+Gtk = imports.gi.Gtk
+
+# JavaScript imports happen via imports.filename, where filename.js
+# is assumed to be available in module/ folder
+
+Gtk.init 0, null
+
+win = new Gtk.Window
+ type: Gtk.WindowType.TOPLEVEL
+win.set_border_width 10
+
+win.connect "destroy", (widget) ->
+ Gtk.main_quit()
+
+button = new Gtk.Button
+ label: "Hello, world"
+
+button.connect "clicked", ->
+ button.set_label "Bar"
+
+win.add button
+button.show()
+win.show()
+
+Gtk.main()