Update gtk.js

This commit is contained in:
Namhyeon Go 2020-10-26 21:35:47 +09:00
parent a6fc2347a0
commit e257414770

View File

@ -46,7 +46,7 @@ var GTKCreateWidget = function(widget) {
case "Button":
commands.push([
"gtk_button_new_with_label",
widget.text
"\"" + widget.text + "\""
]);
break;
@ -63,7 +63,7 @@ var GTKCreateWidget = function(widget) {
commands.push([
"gtk_radio_button_new_with_label_from_widget",
widget.member,
widget.text
"\"" + widget.text + "\""
]);
break;
@ -191,7 +191,7 @@ var Entry = function() {
};
this.empty = function() {
return GTKExecCommand([
GTKExecCommand([
"gtk_editable_delete_text",
this.widgetID,
0,
@ -199,16 +199,20 @@ var Entry = function() {
]);
};
this.getText = function() {
return GTKExecCommand([
this.text = GTKExecCommand([
"gtk_entry_get_text",
this.widgetID
]);
return this.text;
};
this.setText = function(text) {
return GTKExecCommand([
this.text = text;
GTKExecCommand([
"gtk_entry_set_text",
this.widgetID,
CHR(34) + text + CHR(10) + CHR(34)
"\"" + this.text + "\""
]);
};
@ -236,13 +240,14 @@ var TextBox = function() {
this.text = "New TextBox";
this.setText = function(text) {
return GTKExecCommand([
this.text = text;
GTKExecCommand([
"gtk_text_insert",
this.widgetID,
"NULL",
"NULL",
"NULL",
CHR(34) + text + CHR(10) + CHR(34),
"\"" + this.text + "\""
"-1"
]);
};