Re: Strange Problems w/ gnome_error_dialog
- From: Eric Mader <mader jtcsv com>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Strange Problems w/ gnome_error_dialog
- Date: Fri, 31 Oct 2003 17:40:23 -0800
Owen Taylor wrote:
On Fri, 2003-10-31 at 12:05, Eric Mader wrote:
Hello,
I use the following simple method to issue error dialogs in the Gnome
version of a cross-platform application:
void GnomeGUISupport::postErrorMessage(const char *message, const char
*title)
{
gchar *s;
GtkWidget *error;
s = g_strconcat(title, ":\n", message, NULL);
error = gnome_error_dialog(s);
gtk_widget_show(error);
g_free(s);
}
Sometimes when this method is called I see the following error message
on the console:
Gtk-CRITICAL **: file gtkwidget.c: line 1554 (gtk_widget_show_all):
assertion 'widget != NULL' failed.
I'd run with --g-fatal-warnings and get a backtrace. Nothing above looks
suspicious.
Right. The problems turned out to be with the error handling in the
application. In some failure cases it would try to use a NULL top-level
widget, which is the reason for assertion failure.
In one particular failure case, the application would go into a (semi-)
infinite loop, which explains why it would go into the weeds for several
minutes. (in the loop it was adding items to a growable array. I assume
that at some point it ran out of resources and the Kernel killed it...
*before* it got to the main loop, so the dialog never displayed...)
Regards,
Owen
Regards,
Eric
(This looks like GNOME-1.2, so basically off-topic for this list in
point of fact; if you were using GTK+-2.x, GtkMessageDialog provides
a replacement for gnome_error_dialog()...)
My RedHat9 system doesn't seem to have GTK-2.* installed :-( I wonder if
it didn't install it because I upgraded a RH7.3 system...
In any case, the application is the ICU LayoutEngine sample, and it
needs to run on our supported RedHat platforms, which include RH 6 and
7, so I probably need to stick w/ GNOME-1.2.
BTW: When I checked the web for information about gnome_error_dialog, it
was marked as deprecated, but the note didn't say what to use instead.
For deprecated functions, it's a good idea to say what should be used
instead.
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]