Re: GtkListStore and Threads problems



Hi,

This is my app's main function:

int main (int argc, char **argv)

{

        /* init threads */
        g_thread_init(NULL);
        
        gdk_threads_init();
        
        /* init gtk */
        gtk_init (&argc, &argv);
        
        /* create the model and fill with data */
        create_and_fill_model();

        /* create the window with a tree_view and an icon_view */
        create_window_and_views_for_model();

        /* start the worker thread */
        create_and_start_worker_thread ();

        /* enter the GTK main loop */
        gdk_threads_enter(); 
        
        gtk_main();
        
        gdk_threads_leave();
        
        return 0;

}

I don't surround function calls in the main loop (eg: callbacks like row
changed)
because this will actually block the main thread.

Regards,
Lorena

On Tue, 2005-06-14 at 11:25, Owen Taylor wrote:
On Tue, 2005-06-14 at 09:59 -0300, Lorena Salinas wrote:
Hello,

I'm having problems with threads and a gtkliststore model.

My working thread updates a column value of a gtkliststore model using 
gtk_list_store_set() (every call surrounded by gdk_threads_enter() and 
gdk_threads_leave ()). That seems to be working right.

And you are also surrounding all calls to GTK+ in the main thread by
these calls? And you've called gdk_threads_init()?

Regards,
                                      Owen





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