Update gtk.js

This commit is contained in:
Namhyeon Go 2020-10-26 21:14:15 +09:00
parent 2bc2759f96
commit eb5f585588

View File

@ -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;