ok, got further. My test app which only has 1 window and 1 function (exit) works.
My main app I get this error:
(test2:1937): dbind-WARNING **: 20:43:57.645: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
[GLib] ../../../glib/gmem.c:136: failed to allocate 4294967296 bytes
Ok, found the problem. I had a event handler called Open and this was in there. It was probably leftovers from a older version of Xojo. I found it when I created a dummy app and checked to see what is created by default. The below wasnt. Its removed and my code now works just fine.
const klibgtk = “libgtk-3”
declare Function gdk_display_get_default lib klibgtk () as ptr
declare Function gdk_display_get_default_screen lib klibgtk (display as ptr) as ptr
declare Function gtk_css_provider_new lib klibgtk () as ptr
declare Function gtk_css_provider_load_from_data lib klibgtk (obj as ptr,data as CString,length as uint32,error as ptr) as Boolean
declare sub gtk_style_context_add_provider_for_screen lib klibgtk (screen as ptr, provider as ptr, priority as int32)
dim screen as ptr=gdk_display_get_default_screen(gdk_display_get_default)
dim provider as ptr=gtk_css_provider_new