Permalink
Browse files

Made the message dialog modal on the example script

Moved the example script to the new tests directroy.
Made the dialog modal, and used the new response signal to close it
  • Loading branch information...
1 parent 60d141a commit 524c3fbdcba0d948eab907d8f87dfee8bae7c5b6 @timheap timheap committed Jan 2, 2011
Showing with 9 additions and 2 deletions.
  1. +4 −1 test.coffee → tests/kitchen-sink.coffee
  2. +5 −1 test.js → tests/kitchen-sink.js
@@ -35,7 +35,10 @@ process.nextTick ->
button.on 'clicked', ->
console.log 'clicked'
- dialog = new gtk.MessageDialog window, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, 'Node.js + GTK <3'
+ dialog = new gtk.MessageDialog window, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, 'Node.js + GTK <3'
+ dialog.on 'response', (response) ->
+ console.log response
+ dialog.destroy()
dialog.show()
hbox2.add button
@@ -30,7 +30,11 @@ process.nextTick(function() {
button.on('clicked', function() {
var dialog;
console.log('clicked');
- dialog = new gtk.MessageDialog(window, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, 'Node.js + GTK <3');
+ dialog = new gtk.MessageDialog(window, gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, 'Node.js + GTK <3');
+ dialog.on('response', function(response) {
+ console.log(response);
+ return dialog.destroy();
+ });
return dialog.show();
});
hbox2.add(button);

0 comments on commit 524c3fb

Please sign in to comment.