Skip to content

Instantly share code, notes, and snippets.

@mx-moth
Created December 24, 2010 05:13
Show Gist options
  • Save mx-moth/753922 to your computer and use it in GitHub Desktop.
Save mx-moth/753922 to your computer and use it in GitHub Desktop.
This program will segfault when the second text box is focused.
#!/usr/bin/env node
var fs, gtk;
gtk = require('node-gtk');
fs = require('fs');
process.nextTick(function() {
var crasher, good, event, hbox, submit, window, i, len;
gtk.init();
console.log('Creating');
crasher = new gtk.Entry;
events = ['changed', 'focus'];
for (i = 0, len = events.length; i < len; ++i) {
event = events[i];
console.log('attaching', event);
crasher.on(event, function() {
console.log('fired:', event);
console.log(arguments.length);
return true;
});
};
good = new gtk.Entry;
hbox = new gtk.Hbox;
hbox.add(good);
hbox.add(crasher);
window = new gtk.Window;
window.add(hbox);
window.setTitle('Testing');
window.setResizable(false);
window.setDefaultSize(400, 20);
console.log('Showing');
return window.show();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment