How to use the node-gtk.importNS function in node-gtk

To help you get started, we’ve selected a few node-gtk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WebReflection / jsgtk / experiments / hello-gtk.js View on Github external
#!/usr/bin/env jsgtk

var
  GNode = require('node-gtk'),
  Gtk = GNode.importNS('Gtk'),
  win
;

GNode.startLoop();
Gtk.init(null);

win = new Gtk.Window({
  title: 'jsgtk',
  window_position: Gtk.WindowPosition.CENTER
});

win.connect('show', Gtk.main);
win.connect('destroy', Gtk.main_quit);

win.set_default_size(200, 80);
win.add(new Gtk.Label({label: 'Hello Gtk+'}));

node-gtk

GNOME Gtk+ bindings for NodeJS

MIT
Latest version published 8 months ago

Package Health Score

64 / 100
Full package analysis