mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-09 05:06:04 +00:00
fix
This commit is contained in:
parent
44c55d30bf
commit
839bdcc69d
|
@ -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,7 +30,10 @@ 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();
|
||||||
table.attach(text, 1, 49, 8, 44);
|
table.attach(text, 1, 49, 8, 44);
|
||||||
|
@ -54,7 +57,7 @@ function main() {
|
||||||
|
|
||||||
// showing window
|
// showing window
|
||||||
win.show();
|
win.show();
|
||||||
|
|
||||||
// focusing entry
|
// focusing entry
|
||||||
entry.focus();
|
entry.focus();
|
||||||
});
|
});
|
10
lib/gtk.js
10
lib/gtk.js
|
@ -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": []
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user