Skip to content

Instantly share code, notes, and snippets.

@mohan43u
Created November 13, 2014 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohan43u/ef87fb40352579f747b0 to your computer and use it in GitHub Desktop.
Save mohan43u/ef87fb40352579f747b0 to your computer and use it in GitHub Desktop.
#!/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