mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-11 20:21:03 +00:00
Update gtk.js
This commit is contained in:
parent
2bc2759f96
commit
eb5f585588
28
lib/gtk.js
28
lib/gtk.js
|
@ -29,25 +29,18 @@ var GTKCreateWidget = function(widget) {
|
|||
case "Window":
|
||||
commands.push([
|
||||
"gtk_window_new",
|
||||
this.type
|
||||
widget.type
|
||||
]);
|
||||
break;
|
||||
|
||||
case "Table":
|
||||
commands.push([
|
||||
"gtk_table_new",
|
||||
this.rows,
|
||||
this.columns,
|
||||
this.homogeneous
|
||||
]);
|
||||
|
||||
// attach sub widgets to table
|
||||
// attach sub widgets to table widget
|
||||
var subWidgets = widget.attachedWidgets;
|
||||
var countSubWidgets = subWidgets.length;
|
||||
while (countSubWidgets > 0) {
|
||||
commands.push([
|
||||
"gtk_table_attach_defaults",
|
||||
this.widgetID,
|
||||
widget.widgetID,
|
||||
subWidgets[i].widget.widgetID,
|
||||
subWidgets[i].left,
|
||||
subWidgets[i].right,
|
||||
|
@ -57,12 +50,21 @@ var GTKCreateWidget = function(widget) {
|
|||
|
||||
countSubWidgets--;
|
||||
}
|
||||
|
||||
// create table widget
|
||||
commands.push([
|
||||
"gtk_table_new",
|
||||
widget.rows,
|
||||
widget.columns,
|
||||
widget.homogeneous
|
||||
]);
|
||||
|
||||
break;
|
||||
|
||||
case "Button":
|
||||
commands.push([
|
||||
"gtk_button_new_with_label",
|
||||
this.text
|
||||
widget.text
|
||||
]);
|
||||
break;
|
||||
|
||||
|
@ -78,8 +80,8 @@ var GTKCreateWidget = function(widget) {
|
|||
case "RadioBox":
|
||||
commands.push([
|
||||
"gtk_radio_button_new_with_label_from_widget",
|
||||
this.member,
|
||||
this.text
|
||||
widget.member,
|
||||
widget.text
|
||||
]);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user