node-gtk-cc

0.0.18 • Public • Published

node-gtk

GNOME Gtk+ bindings for NodeJS

What is this

A work in progress to bring Gtk+ usable directly from nodejs so that the environemnt would be more udated and supported than the one available via GJS.

Please note this project is currently in an alpha state and it needs more contributors.

How to install

Currently, Linux is the main target but we are working to make this work on OSX too.

If you have installed gtk3 you should be already OK and off via npm install node-gtk

Once installed, you can import various namespaces as following:

#!/usr/bin/env node
 
var
  GNode = require('node-gtk'),
  Gtk = GNode.importNS('Gtk'),
  win
;
 
GNode.startLoop();
Gtk.init(0, null);
 
win = new Gtk.Window({
  title: 'node-gtk',
  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+'}));
 
win.show_all();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.18
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.18
    0

Package Sidebar

Install

npm i node-gtk-cc

Weekly Downloads

0

Version

0.0.18

License

MIT

Last publish

Collaborators

  • webreflection