mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update gtk.js
This commit is contained in:
parent
7f3673608a
commit
60cddaa05a
13
lib/gtk.js
13
lib/gtk.js
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user