diff --git a/lib/gtk.js b/lib/gtk.js index 463eb2a..f096042 100644 --- a/lib/gtk.js +++ b/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;