mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 23:14:58 +00:00
Update gtk.js
This commit is contained in:
parent
7f3673608a
commit
60cddaa05a
11
lib/gtk.js
11
lib/gtk.js
|
@ -37,13 +37,15 @@ var GTKWidget = function(options) {
|
||||||
this.setWidgetType = function(widgetType) {
|
this.setWidgetType = function(widgetType) {
|
||||||
this.widgetType = widgetType;
|
this.widgetType = widgetType;
|
||||||
};
|
};
|
||||||
this.create = function(callback) {
|
this.update = function() {
|
||||||
if (typeof(options) === "object") {
|
if (typeof(options) === "object") {
|
||||||
for (var k in options) {
|
for (var k in options) {
|
||||||
this[k] = options[k];
|
this[k] = options[k];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
this.create = function() {
|
||||||
|
this.update();
|
||||||
this.dispatchEvent(new GTKEvent("load"));
|
this.dispatchEvent(new GTKEvent("load"));
|
||||||
this.widgetID = GTKCreateWidget(this);
|
this.widgetID = GTKCreateWidget(this);
|
||||||
GTKWidgets[this.widgetID] = this;
|
GTKWidgets[this.widgetID] = this;
|
||||||
|
@ -116,7 +118,7 @@ var GTKCreateWidget = function(widget) {
|
||||||
case "RadioBox":
|
case "RadioBox":
|
||||||
commands.push([
|
commands.push([
|
||||||
"gtk_radio_button_new_with_label_from_widget",
|
"gtk_radio_button_new_with_label_from_widget",
|
||||||
"NULL",
|
widget.memberWidget.widgetID,
|
||||||
"\"" + widget.text + "\""
|
"\"" + widget.text + "\""
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
@ -334,6 +336,7 @@ var RadioBox = function() {
|
||||||
|
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
|
||||||
|
this.update();
|
||||||
if (this.group.widgetID != "NULL") {
|
if (this.group.widgetID != "NULL") {
|
||||||
this.group.add(this);
|
this.group.add(this);
|
||||||
}
|
}
|
||||||
|
@ -351,7 +354,7 @@ var RadioGroup = function() {
|
||||||
this.widgetType = "RadioGroup";
|
this.widgetType = "RadioGroup";
|
||||||
|
|
||||||
this.add = function(widget) {
|
this.add = function(widget) {
|
||||||
if (memberWidgets.length > 0) {
|
if (this.memberWidgets.length > 0) {
|
||||||
widget.setMemberWidget(this.memberWidgets[0]);
|
widget.setMemberWidget(this.memberWidgets[0]);
|
||||||
}
|
}
|
||||||
this.memberWidgets.push(widget);
|
this.memberWidgets.push(widget);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user