Re: dialogue and threads



Yves Willems wrote:
Hi all,

I have a multi threaded GTK app and want to show an error dialogue for an
error that occurred on a thread different then the main thread.

When showing the dialogue on this thread, the 'waiting for OK' blocks the
main thread and therefore freezes my GUI.


Can anyone give me a hint how to tackle such a problem?

/* Thread that recieved the error */
text = g_strdup_printf ("The error that occurred");
g_idle_add (report_error_dialog, text);

/* Main Thread */
gboolean
report_error_dialog (gchar *text)
{
        /* Show "text" in dialog here */

        g_free (text);
        return FALSE;
}

Cheers,
                 -Tristan



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