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
win = new GTK.Window({
title: "Hello world",
title: "WelsonJS GTK GUI Demo Application",
width: 450,
height: 400
});
@ -30,7 +30,10 @@ function main() {
// create new entry
entry = new GTK.Entry();
table.attach(entry, 1, 40, 45, 49);
entry.addEventListener("enter", function(event) {
console.info(event.target.getText());
});
// create new textbox
text = new GTK.TextBox();
table.attach(text, 1, 49, 8, 44);
@ -54,7 +57,7 @@ function main() {
// showing window
win.show();
// focusing entry
entry.focus();
});

View File

@ -1,5 +1,11 @@
////////////////////////////////////////////////////////////////////////
//
// 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");
@ -33,8 +39,6 @@ var GTKWidget = function(options) {
}
};
this.eventListener = function() {
console.info("eventListener");
this.dispatchEvent(new GTKEvent("wait"));
return GTKEventListener(this);
};
@ -61,7 +65,7 @@ var definedEvents = {
"Window": [],
"Table": [],
"Button": ["click"],
"Entry": ["keyup"],
"Entry": ["enter"],
"RadioBox": ["click"],
"TextBox": []
};