mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 21:51:04 +00:00
Update gtk.js
This commit is contained in:
parent
8560f2eb45
commit
8bba929f18
18
lib/gtk.js
18
lib/gtk.js
|
@ -16,7 +16,7 @@ var GTKWidgets = {};
|
||||||
// Common (Element)
|
// Common (Element)
|
||||||
var GTKWidget = function() {
|
var GTKWidget = function() {
|
||||||
this.widgetType = "GTKWidget";
|
this.widgetType = "GTKWidget";
|
||||||
|
|
||||||
this.dispatchEvent = function(event) {
|
this.dispatchEvent = function(event) {
|
||||||
event.target = this;
|
event.target = this;
|
||||||
if(event.eventName in this) {
|
if(event.eventName in this) {
|
||||||
|
@ -37,10 +37,11 @@ var GTKWidget = function() {
|
||||||
this.setWidgetType = function(widgetType) {
|
this.setWidgetType = function(widgetType) {
|
||||||
this.widgetType = widgetType;
|
this.widgetType = widgetType;
|
||||||
};
|
};
|
||||||
|
this.create = function() {
|
||||||
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;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Common (definedEvents)
|
// Common (definedEvents)
|
||||||
|
@ -190,6 +191,7 @@ var Window = function() {
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
this.create();
|
||||||
};
|
};
|
||||||
Window.prototype = new GTKWidget();
|
Window.prototype = new GTKWidget();
|
||||||
Window.prototype.constructor = Window;
|
Window.prototype.constructor = Window;
|
||||||
|
@ -219,6 +221,7 @@ var Table = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
this.create();
|
||||||
};
|
};
|
||||||
Table.prototype = new GTKWidget();
|
Table.prototype = new GTKWidget();
|
||||||
Table.prototype.constructor = Table;
|
Table.prototype.constructor = Table;
|
||||||
|
@ -231,6 +234,7 @@ var Button = function() {
|
||||||
this.text = "New Button";
|
this.text = "New Button";
|
||||||
|
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
this.create();
|
||||||
};
|
};
|
||||||
Button.prototype = new GTKWidget();
|
Button.prototype = new GTKWidget();
|
||||||
Button.prototype.constructor = Button;
|
Button.prototype.constructor = Button;
|
||||||
|
@ -277,6 +281,7 @@ var Entry = function() {
|
||||||
|
|
||||||
this.setText(this.text);
|
this.setText(this.text);
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
this.create();
|
||||||
};
|
};
|
||||||
Entry.prototype = new GTKWidget();
|
Entry.prototype = new GTKWidget();
|
||||||
Entry.prototype.constructor = Entry;
|
Entry.prototype.constructor = Entry;
|
||||||
|
@ -290,6 +295,7 @@ var RadioBox = function() {
|
||||||
this.member = "NULL";
|
this.member = "NULL";
|
||||||
|
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
this.create();
|
||||||
};
|
};
|
||||||
RadioBox.prototype = new GTKWidget();
|
RadioBox.prototype = new GTKWidget();
|
||||||
RadioBox.prototype.constructor = RadioBox;
|
RadioBox.prototype.constructor = RadioBox;
|
||||||
|
@ -316,6 +322,7 @@ var TextBox = function() {
|
||||||
|
|
||||||
this.setText(this.text);
|
this.setText(this.text);
|
||||||
this.setWidgetType(this.widgetType);
|
this.setWidgetType(this.widgetType);
|
||||||
|
this.create();
|
||||||
};
|
};
|
||||||
TextBox.prototype = new GTKWidget();
|
TextBox.prototype = new GTKWidget();
|
||||||
TextBox.prototype.constructor = TextBox;
|
TextBox.prototype.constructor = TextBox;
|
||||||
|
@ -351,6 +358,7 @@ exports.Button = Button;
|
||||||
exports.Entry = Entry;
|
exports.Entry = Entry;
|
||||||
exports.RadioBox = RadioBox;
|
exports.RadioBox = RadioBox;
|
||||||
exports.TextBox = TextBox;
|
exports.TextBox = TextBox;
|
||||||
|
|
||||||
exports.init = GTKInit;
|
exports.init = GTKInit;
|
||||||
exports.wait = GTKWait;
|
exports.wait = GTKWait;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user