Hi All,
I'm have problems understanding how to get the gnome about dialog
working properly with libglade. If I have the following:
static GladeXML *xml;
void
on_about_activate( GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *about_dlg = glade_xml_get_widget( xml, "about");
gtk_widget_show( about_dlg);
}
The first time I call on_about_activate( ...), then the about dialog
comes up as expected. When I click the OK button on the dialog,
it also disappears ( I don't define this callback since the GGAD
tells me that there is a default callback to this click which closes
the dialog). However, if I then try to call
on_about_activate( ...) a second time, the dialog fails to appear,
and I get the following message:
Gtk-CRITICAL **: file gtkwidget.c: line 1425 (gtk_widget_show):
assertion `GTK_IS_WIDGET (widget)' failed.
If I replace the callback above with the following, then I don't
get the error message, the program simply crashes (with a segmentation
fault).
void
on_about_activate( GtkMenuItem *menuitem,
gpointer user_data)
{
static GtkWidget *about_dlg = NULL;
if( about_dlg != NULL)
{
gdk_window_show( about_dlg->window);
gdk_window_raise( about_dlg->window);
return;
}
about_dlg = glade_xml_get_widget( xml, "about");
gtk_widget_show( about_dlg);
}
Can somebody please enlighten me as to what going on, and what I'm
doing wrong.
Thanks,
Edgar.
+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.