src/Builder4/MainWindow.bjs
authorAlan <alan@roojs.com>
Thu, 7 Jul 2022 07:29:37 +0000 (15:29 +0800)
committerAlan <alan@roojs.com>
Thu, 7 Jul 2022 07:29:37 +0000 (15:29 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index ab71b5c..738f4f0 100644 (file)
            "\t \tthis.el.detach(m);",
            "\t }",
            "\t this.mitems.clear();",
-           "\t for(var w in this.application.windows) {",
-           "\t \tvar m = new Gtk.MenuItem.with_label(window.file.toString());",
-           "\t ",
-           "\t ",
+           "\t for(var wid in this.application.windows.keys) {",
+           "\t \tvar w = this.applications.windows.get(wid);",
+           "\t \tvar m = new Gtk.MenuItem.with_label(w.windowstate.file.toString());",
+           "\t \tm.activate.connect(() => {",
+           "\t \t\tthis.application.bringToFront(this.application.windows.get(wid));",
+           "\t \t});",
            "\t }",
            "\t ",
            "}",
index 312477a..a79f525 100644 (file)
@@ -257,10 +257,12 @@ public class Xcls_MainWindow : Object
                        this.el.detach(m);
                 }
                 this.mitems.clear();
-                for(var w in this.application.windows) {
-                       var m = new Gtk.MenuItem.with_label(window.file.toString());
-                
-                
+                for(var wid in this.application.windows.keys) {
+                       var w = this.applications.windows.get(wid);
+                       var m = new Gtk.MenuItem.with_label(w.windowstate.file.toString());
+                       m.activate.connect(() => {
+                               this.application.bringToFront(this.application.windows.get(wid));
+                       });
                 }
                 
             });