Re: gtk_message_dialog problem
- From: "Michael Lamothe" <michael lamothe gmail com>
- To: "Jordan Walsh" <jordanwalsh gmail com>, gtk-app-devel-list gnome org
- Subject: Re: gtk_message_dialog problem
- Date: Sun, 4 Nov 2007 17:21:23 +1100
Apologies to the thread. I keep forgetting to reply to all.
GTK is not thread safe. But if you code carefully your application
can be thread safe. You cannot access GTK/GDK from more than one
thread without proper multi-thread protection. I have no idea of the
internal workings of GTK but accessing from multiple threads without
protecting it results in unpredictable results.
Thanks,
Michael
On 04/11/2007, Jordan Walsh <jordanwalsh gmail com> wrote:
Yip, that did it. What was that? GTK locking its structures, etc to only its
thread? I am foggy when it comes to the internals of GLIB and GTK. But I
need to get better in that department.
On 11/4/07, Michael Lamothe <michael lamothe gmail com> wrote:
Hi Jordan,
I'll ask the obvious, is your application a multi-threaded
application? Mine did exactly the same thing when I tried to do this
from a different thread.
Thanks,
Michael
On 04/11/2007, Jordan Walsh < jordanwalsh gmail com> wrote:
Hi all, whenever I create a gtk_message_dialog and run it, it locks my
entire application requiring a kill. This is the code I am using which
basically mimics the example in the api documentation.
void error_dialog(gpointer info)
{
GtkWidget* dialog;
dialog = gtk_message_dialog_new (GTK_WINDOW(window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
"Error: %s",info
);
g_message("destroying");
gtk_widget_destroy(dialog);
}
The "destroying" message was a test to see where it was locking. It does
print the message when the button is clicked but the window does not
destroy.
--
Jordan Walsh
(910) 639-0111
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
Jordan Walsh
(910) 639-0111
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]