g_signal_emit_by_name
- From: Thym <thymus gmail com>
- To: gtk-app-devel-list gnome org
- Subject: g_signal_emit_by_name
- Date: Sun, 14 Aug 2005 20:44:33 +0200
Good evening everybody !
I speak french, so sorry for mistakes :]
I think I have matter with g_signal_emit_by_name.
I sent a signal with :
g_signal_emit_by_name(G_OBJECT(pMyApp->pWindow), "delete_event");
Before, I connected this signal with :
g_signal_connect(G_OBJECT(pMyApp->pWindow), "delete_event",
G_CALLBACK(delete_event), (gpointer)pMyApp);
My function delete_event is :
static gboolean delete_event(GtkWidget *pWidget, GdkEvent *event, gpointer
pdata) {
MainWindow *pMyApp;
GtkWidget *pQuestion;
gboolean bRetour;
pMyApp = (MainWindow *)pdata;
if ( pMyApp->is_menu_edited ) {
pQuestion = gtk_message_dialog_new(GTK_WINDOW(pMyApp->pWindow),
GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
"\nEtes-vous sûr de vouloir\nquitter sans enregistrer ?");
gtk_window_set_title(GTK_WINDOW(pQuestion), "Quitter ?");
switch ( gtk_dialog_run(GTK_DIALOG(pQuestion)) ) {
case GTK_RESPONSE_YES:
bRetour = FALSE;
break;
case GTK_RESPONSE_NO:
bRetour = TRUE;
}
gtk_widget_destroy(pQuestion);
return bRetour;
}
else
return FALSE;
}
If I closed the window with the window manager, all's right.
But, if I send "delete_event", the function delete_event is right called,
but I have an error after :
(gdb) run
Starting program: /home/thymus/svn/fb-menu-editor/obj/fb-menu-editor
Program received signal SIGSEGV, Segmentation fault.
0xb7b4c823 in g_pointer_type_register_static () from
/usr/X11R6/lib/libgobject-2.0.so.0
I don't understand why...
Thank you :]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]