a | b | |
---|
| 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() |
---|
... | |
---|