GTK basic setup with timer in main thread

From AcrodusWiki

Hello future Alex,

This is extract of your GTK rail control system application. Past Alex has added this as refer rence on how to setup with GTK4. This also attaches a timer in the main thread.

Not everything is in the below extract, however should jog your memory on the function calls to use.

int main(int argc, char **argv){

        gtk_init();
        gboolean done = FALSE;
        
        GMainLoop *loop =NULL;
        loop = g_main_loop_new(NULL, FALSE);

        source = g_timeout_source_new(1000/FPS);
        g_source_set_name(source, "redraw");
        g_source_set_priority(source, G_PRIORITY_DEFAULT);
        id = g_source_attach(source, NULL);
        g_source_set_callback(source, G_SOURCE_FUNC(timeout_cb), &cbdata, NULL);

        g_main_loop_run(loop);
        g_main_loop_unref(loop);