mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-03-11 16:35:13 +00:00
Update gtk.js
This commit is contained in:
parent
a6fc2347a0
commit
e257414770
21
lib/gtk.js
21
lib/gtk.js
|
@ -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"
|
||||
]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user