Currently I’m developing a multi-thread application. I use a TreeView to display the states of each thread, one row per thread.
There are mainly two classes:
- Main GUI class containing TreeView
- class for thread handling
Passing Gtk::TreeModel::iterator as an argument to the second class is not viable since we cannot access the elements in row in formats like row[m_Columns.m_id].
Using Glib::Dispatcher is also unavailable since the elements we change in the external function is thread-specific.
So, is there any practical method to update GUI from external functions?
It’s available to declare a class for Columns in an external file and include the file in both GUI class file and thread class file.
Like
So that if you created a Columns instance m_columns in GUI class, and passed it as a parameter to thread class, you can use
to access the elements in TreeModel.