After trying the new idea of drawing on to the parent widget I am getting crashes in the code
static extern(C) void gtkd_container_remove(GtkContainer* c, GtkWidget* w)
{
import gobject.c.functions : g_object_get_data;
if ( auto container = cast(Container)g_object_get_data(cast(GObject*)c, "GObject") )
if ( auto widget = cast(Widget)g_object_get_data(cast(GObject*)w, "GObject") )
{
import std.algorithm : remove;
container.children.remove!(a => a is widget)();
}
}
in Container.d
I'm not sure exactly why, it might be my code, but obviously it should not crash.
Exception thrown: read access violation.
std.range.primitives.front!(gtk.Widget.Widget).front(...) returned 0xFFFFFFFFFFFFFFFF.
The code should probably check for this and ignore such errors?