Created
November 13, 2014 08:46
-
-
Save mohan43u/ef87fb40352579f747b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env gjs | |
const Lang = imports.lang; | |
const GLib = imports.gi.GLib; | |
const GObject = imports.gi.GObject; | |
let Helloworld = Lang.Class({ | |
Name: "Helloworld", | |
Extends: GObject.Object, | |
_init: function() { | |
GObject.Object.prototype._init.call(this); | |
this.mainloop = imports.mainloop; | |
}, | |
__idle_cb: function() { | |
print("hello world"); | |
this.mainloop.quit(); | |
}, | |
run: function() { | |
this.mainloop.idle_add(Lang.bind(this, this.__idle_cb)); | |
this.mainloop.run(); | |
} | |
}); | |
let helloworld = new Helloworld(); | |
helloworld.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment