Update gtk.js

This commit is contained in:
Namhyeon Go 2020-10-28 17:22:29 +09:00
parent 7f3673608a
commit 60cddaa05a

View File

@ -37,13 +37,15 @@ var GTKWidget = function(options) {
this.setWidgetType = function(widgetType) {
this.widgetType = widgetType;
};
this.create = function(callback) {
this.update = function() {
if (typeof(options) === "object") {
for (var k in options) {
this[k] = options[k];
}
}
};
this.create = function() {
this.update();
this.dispatchEvent(new GTKEvent("load"));
this.widgetID = GTKCreateWidget(this);
GTKWidgets[this.widgetID] = this;
@ -116,7 +118,7 @@ var GTKCreateWidget = function(widget) {
case "RadioBox":
commands.push([
"gtk_radio_button_new_with_label_from_widget",
"NULL",
widget.memberWidget.widgetID,
"\"" + widget.text + "\""
]);
break;
@ -334,10 +336,11 @@ var RadioBox = function() {
this.setWidgetType(this.widgetType);
this.update();
if (this.group.widgetID != "NULL") {
this.group.add(this);
}
this.create();
};
RadioBox.prototype = new GTKWidget();
@ -351,7 +354,7 @@ var RadioGroup = function() {
this.widgetType = "RadioGroup";
this.add = function(widget) {
if (memberWidgets.length > 0) {
if (this.memberWidgets.length > 0) {
widget.setMemberWidget(this.memberWidgets[0]);
}
this.memberWidgets.push(widget);