Re: display stopped by another program

Kind Sir,

Is it possible that I should be using the GTK Animation features to display successive iterations of the cellular automata?


On 01/18/2018 02:04 PM, Daniel Boles wrote:
I get that it may have *seemed* to work, but it was under no obligation to, and you started to see the evidence of that. :P

Making a GTK+ instance global alone seems unable to solve the problem: what you need is to stop manipulating it from threads that didn't initialise GTK+ / aren't running the GLib/GTK+ main loop.

Not that I immediately have a ready-made alternative, but the architecture you described seems somewhat less than ideal to me. I would personally try for a model/view architecture, i.e. have whatever thread you want calculating the next frame of the cell grid, then sending a signal to the GUI thread when it is done and the GUI should update to reflect the new data. Alternatively, have GTK+ periodically check whether a new frame is ready and, if so, update from the world data.

gtkmm-list mailing list
gtkmm-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]