Add your logic to a function given to glib_idle_add(), and to trigger new drawings call queue_draw and then return from your function. GTK+ will call your draw signal handler. As soon as GTK+ is idle again, your function will be called again.
It isn't the usual way of doing things, but it will work. On Tue, Sep 04, 2018 at 07:09:13PM -0300, Juan Ignacio Donoso via gtk-app-devel-list wrote: > I'm trying to create a GUI using gtk.... I already have a loop that runs my > logic. I was using cairo to draw to a png and flush to /dev/fb0 but now I > want to instantiate a Gtk::Window to draw on it. > > I don't want to run Gtk::Main because just want to trigger new drawings > when my logic trigger it.. > The app is real only there aren't going to be any interactions from the app > ui, only from the internal logic I want to draw. > > Any idea where to look to implement that approach. I was thinking on using > Gtk::main_iteration_do with Gtk::Queue_draw. But I'm not getting it work. > > Do I need to ask for a cairo context on every on_draw signal call? > Do I need to "draw" on the "draw" signal? > > thanks > _______________________________________________ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- James Cameron http://quozl.netrek.org/ _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list