This commit is contained in:
Namhyeon Go 2020-10-28 17:43:24 +09:00
parent 44c55d30bf
commit 839bdcc69d
2 changed files with 13 additions and 6 deletions

View File

@ -6,7 +6,7 @@ function main() {
// create new window // create new window
win = new GTK.Window({ win = new GTK.Window({
title: "Hello world", title: "WelsonJS GTK GUI Demo Application",
width: 450, width: 450,
height: 400 height: 400
}); });
@ -30,6 +30,9 @@ function main() {
// create new entry // create new entry
entry = new GTK.Entry(); entry = new GTK.Entry();
table.attach(entry, 1, 40, 45, 49); table.attach(entry, 1, 40, 45, 49);
entry.addEventListener("enter", function(event) {
console.info(event.target.getText());
});
// create new textbox // create new textbox
text = new GTK.TextBox(); text = new GTK.TextBox();

View File

@ -1,5 +1,11 @@
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//
// GTKServer API // GTKServer API
//
// * Breif: GTK GUI Programming with WSH (Windows Scripting Host)
// * Author: Go Namhyeon <gnh1201@gmail.com>
// * Project site: https://github.com/gnh1201/welsonjs
//
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell"); var SHELL = require("lib/shell");
@ -33,8 +39,6 @@ var GTKWidget = function(options) {
} }
}; };
this.eventListener = function() { this.eventListener = function() {
console.info("eventListener");
this.dispatchEvent(new GTKEvent("wait")); this.dispatchEvent(new GTKEvent("wait"));
return GTKEventListener(this); return GTKEventListener(this);
}; };
@ -61,7 +65,7 @@ var definedEvents = {
"Window": [], "Window": [],
"Table": [], "Table": [],
"Button": ["click"], "Button": ["click"],
"Entry": ["keyup"], "Entry": ["enter"],
"RadioBox": ["click"], "RadioBox": ["click"],
"TextBox": [] "TextBox": []
}; };