You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Licensed under the terms of an MIT license: http://www.opensource.org/licenses/mit-license.php
4
4
5
-
localLuaGObject=require'LuaGObject'
6
-
localcore=require'LuaGObject.core'
5
+
localLuaGObject=require"LuaGObject"
7
6
localGtk=LuaGObject.Gtk
8
7
localGdk=LuaGObject.Gdk
9
-
localGObject=LuaGObject.GObject
10
-
localcairo=LuaGObject.cairo
11
8
12
-
locallog=LuaGObject.log.domain('LuaGObject.Gtk4')
9
+
locallog=LuaGObject.log.domain"LuaGObject.Gtk4"
13
10
14
11
assert(Gtk.get_major_version() ==4)
15
12
@@ -29,7 +26,7 @@ Gtk.Allocation = Gdk.Rectangle
29
26
Gtk.Widget._attribute= {
30
27
width= { get=Gtk.Widget.get_allocated_width },
31
28
height= { get=Gtk.Widget.get_allocated_height },
32
-
child= {},
29
+
children= {},
33
30
}
34
31
35
32
-- Allow to query a widget's currently-allocated dimensions by indexing .width or .height, and set the requested dimensions by assigning these pseudo-properties.
@@ -41,8 +38,8 @@ function Gtk.Widget._attribute.height:set(height)
41
38
end
42
39
43
40
-- Access children by index. [1] returns the first child, [2] returns the second, [-1] returns the last, [-2] returns the second-last. If no child exists at the given index, returns nil.
44
-
localwidget_child_mt= {}
45
-
functionwidget_child_mt:__index(key)
41
+
localwidget_children_mt= {}
42
+
functionwidget_children_mt:__index(key)
46
43
iftype(key) ~="number" then
47
44
error("%s: cannot access child at non-numeric index", self._widget.type.name)
48
45
end
@@ -65,85 +62,17 @@ function widget_child_mt:__index(key)
0 commit comments