src/JsRender/NodeToVala.vala
authorAlan Knowles <alan@roojs.com>
Sun, 10 Mar 2024 03:04:48 +0000 (11:04 +0800)
committerAlan Knowles <alan@roojs.com>
Sun, 10 Mar 2024 03:04:48 +0000 (11:04 +0800)
src/JsRender/NodeToVala.vala

index a549857..9595bf1 100644 (file)
@@ -452,7 +452,21 @@ public abstract class JsRender.NodeToVala : NodeWriter {
                }
                
                if (this.node.fqn() == "Gtk.NotebookPage" && nb_child != "") {
-                       this.addLine(@"$(ipad)notebook.el.append_page( $(nb_child, $(nb_label));");
+                       if (nb_tab == "" && this.node.hasProp("tab_label")) {
+                               nb_tab = "new Gtk.Label(this.tab_label)";
+                                       return;
+                               }
+                       } 
+                       if (nb_menu == "" && nb_tab == "") {
+                       
+                               this.addLine(@"$(ipad)notebook.el.append_page( $(nb_child)  );");
+                               return;
+                       }
+                       if (nb_menu == "") {
+                               this.addLine(@"$(ipad)notebook.el.append_page( $(nb_child) , $(nb_tab) );");
+                               return;
+                       }
+                       this.addLine(@"$(ipad)notebook.el.append_page_menu( $(nb_child) , $(nb_tab), $(nb_menu) );");
                
                }