src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 12:21:37 +0000 (20:21 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 2 Jun 2015 12:21:37 +0000 (20:21 +0800)
src/Builder4/MainWindow.vala

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

index 45869cc..120ab1e 100644 (file)
         },
         {
          "listeners" : {
-          "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\treturn;\n\t}\n\tGee.ArrayList<int> res = new Gee.ArrayList<int>();;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\tvar res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n\tif (res.size > 0) {\n\t\t_this.search_results.el.text = \"%d Matches\".printf(res.size);\n\t} else {\n\t\t_this.search_results.el.text = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
+          "changed" : "() => {\n\tif (this.el.text == \"\") {\n\t\treturn;\n\t}\n\tGee.ArrayList<int> res = new Gee.ArrayList<int>();;\n\tswitch(_this.windowstate.state) {\n\t\tcase WindowState.State.CODEONLY:\n\t\tcase WindowState.State.CODE:\n\t\t\t// search the code being edited..\n\t\t\tres = _this.windowstate.code_editor.search(this.el.text);\n\t\t\t\n\t\t\tbreak;\n\t\tcase WindowState.State.PREVIEW:\n\t\t\tif (_this.windowstate.file.xtype == \"Gtk\") {\n\t\t\t\tvar res = _this.windowstate.window_gladeview.search(this.el.text);\n\t\t\t}\n\t\t\n\t\t\tbreak;\n\t}\n\tif (res.size > 0) {\n\t\t_this.search_results.el.label = \"%d Matches\".printf(res.size);\n\t} else {\n\t\t_this.search_results.el.label = \"No Matches\";\n\t}\n\t\t\n\t\n\t\n}\n"
          },
          "id" : "search_entry",
          "* init" : "var description =   Pango.FontDescription.from_string(\"monospace\");\n\tdescription.set_size(8000);\n\t this.el.override_font(description);\n\n",
index 3749726..6efb8fd 100644 (file)
@@ -2339,16 +2339,16 @@ public class Xcls_MainWindow : Object
                                
                                break;
                        case WindowState.State.PREVIEW:
-                               if (this.windowstate.file.xtype == "Gtk") {
+                               if (_this.windowstate.file.xtype == "Gtk") {
                                        var res = _this.windowstate.window_gladeview.search(this.el.text);
                                }
                        
                                break;
                }
                if (res.size > 0) {
-                       _this.search_results.el.text = "%d Matches".printf(res.size);
+                       _this.search_results.el.label = "%d Matches".printf(res.size);
                } else {
-                       _this.search_results.el.text = "No Matches";
+                       _this.search_results.el.label = "No Matches";
                }