src/Builder4/Editor.bjs
authorAlan <alan@roojs.com>
Wed, 27 Mar 2024 09:15:16 +0000 (17:15 +0800)
committerAlan <alan@roojs.com>
Wed, 27 Mar 2024 09:15:16 +0000 (17:15 +0800)
src/Builder4/Editor.vala

src/Builder4/Editor.bjs
src/Builder4/Editor.vala

index 00137cd..d9a071c 100644 (file)
            "id" : "helper",
            "int margin_end" : 4,
            "int margin_start" : 4,
-           "items" : [
-            {
-             "$ xns" : "Gtk",
-             "listeners" : {
-              "pressed" : [
-               "(n_press, x, y) => {",
-               "\tint ix, tr;",
-               "\t_this.helper.el.get_layout().xy_to_index((int)x, (int)y, out ix, out tr);",
-               "\tGLib.debug(\"label click %d\", ix);",
-               "}",
-               ""
-              ]
-             },
-             "xtype" : "GestureClick"
-            }
-           ],
            "listeners" : {
+            "activate_link" : [
+             "(uri) => {",
+             "",
+             "\treturn bool;",
+             "}",
+             ""
+            ],
             "query_tooltip" : [
              "(x, y, keyboard_tooltip, tooltip) => {",
              "\tGLib.debug(\"using quiery tooltip?\");",
index a337103..1a2716d 100644 (file)
@@ -549,9 +549,6 @@ public class Editor : Object
                        this.el.justify = Gtk.Justification.LEFT;
                        this.el.hexpand = true;
                        this.el.xalign = 0f;
-                       var child_1 = new Xcls_GestureClick61( _this );
-                       child_1.ref();
-                       this.el.add_controller(  child_1.el );
 
                        //listeners
                        this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
@@ -562,6 +559,10 @@ public class Editor : Object
                        
                                return true;
                        });
+                       this.el.activate_link.connect( (uri) => {
+                       
+                               return bool;
+                       });
                }
 
                // user defined functions
@@ -607,35 +608,6 @@ public class Editor : Object
                        
                }
        }
-       public class Xcls_GestureClick61 : Object
-       {
-               public Gtk.GestureClick el;
-               private Editor  _this;
-
-
-                       // my vars (def)
-
-               // ctor
-               public Xcls_GestureClick61(Editor _owner )
-               {
-                       _this = _owner;
-                       this.el = new Gtk.GestureClick();
-
-                       // my vars (dec)
-
-                       // set gobject values
-
-                       //listeners
-                       this.el.pressed.connect( (n_press, x, y) => {
-                               int ix, tr;
-                               _this.helper.el.get_layout().xy_to_index((int)x, (int)y, out ix, out tr);
-                               GLib.debug("label click %d", ix);
-                       });
-               }
-
-               // user defined functions
-       }
-
 
        public class Xcls_Scale6 : Object
        {