creationix / node-gir

Node bindings to libgirepository
http://live.gnome.org/GObjectIntrospection
MIT License
231 stars 58 forks source link

browser.js example fails #9

Closed aeosynth closed 9 years ago

aeosynth commented 12 years ago
$ node browser.js 

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: Requiring namespace 'Gtk' version '2.0', but '3.0' is already loaded
    at Object.<anonymous> (/home/james/src/node-gir/examples/webkit.js:6:35)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at require (module.js:346:19)
    at Object.<anonymous> (/home/james/src/node-gir/examples/browser.js:5:14)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)

yes I have gtk3 installed. example works fine when using gtk2.

swick commented 12 years ago

For me, the example works and I've got gtk2.0 and 3.0 installed. gir.load(name) loads the latest version of name atm. I would like it to search for a already regsitered version if the 2nd parameter is not set. If the namespace is not loaded (any version) and there is no 2nd parameter it should load the latest version. If the 2nd parameter is set we try to load the specific version. I would suggest to do it in JS land with the new functions (isRegistered, getDependencies, loadedNamespaces, getVersion and getVersions).