Issue subclassing GtkLayoutManager in Vala
Hello there, I am trying to implement a custom fixed layout manager in vala from Gtk 4 (pulled and built midday today), it was not possible to subclass FixedLayout so I am replicating the functionality. measure and allocate have successfully been overridden however when it comes to create_layout_child, it will not compile and says,
canvas_layout.vala:49.2-49.52: error: canvas_layout.create_layout_child: no suitable method found to override
public override Gtk.LayoutChild create_layout_child( Gtk.Widget widget, Gtk.Widget for_child)
Here is the full function:
public override Gtk.LayoutChild create_layout_child( Gtk.Widget widget, Gtk.Widget for_child) { return ( canvas_layout_child) GLib.Object.new_with_properties( GLib.Type.from_name( "canvas_layout_child"), { "layout-manager", "child-widget"}, { this, for_child}); }
And here is the C subclass found in gtkfixedlayout.c:
static GtkLayoutChild * gtk_fixed_layout_create_layout_child (GtkLayoutManager *manager, GtkWidget *widget, GtkWidget *for_child) { return g_object_new (GTK_TYPE_FIXED_LAYOUT_CHILD, "layout-manager", manager, "child-widget", for_child, NULL); }
I don't see what the issue here is as the arguments, return type and naming all seem to match. When I don't include the override keyword then it does compile but the assertion in gtklayoutmanager.c doesn't classify the function as valid and throws a fatal error:
`Gtk-WARNING **: 22:16:42.414: Layout managers of type canvas_layout do not implement the GtkLayoutManager::create_layout_child method
Gtk-CRITICAL **: 22:16:42.414: The layout manager of type canvas_layout 0x55dc04ec7860 does not create GtkLayoutChild instances`
I hope this is a valid issue in the project and not a glaring issue on my part, thanks canvas_layout.vala