Mercurial > mplayer.hg
comparison gui/dialog/msgbox.c @ 36008:d154d0035cb0
Don't use WidgetDestroy().
(It's not the best idea to call gtk_widget_destroy() there while the
object is currently being destroyed.)
In order to set the widget pointer to NULL, use gtk_widget_destroyed().
Simply destroy the widget to automatically get the pointer set to NULL
then.
author | ib |
---|---|
date | Sat, 30 Mar 2013 14:32:07 +0000 |
parents | 90ff4280cc80 |
children | 5c720c434d56 |
comparison
equal
deleted
inserted
replaced
36007:90ff4280cc80 | 36008:d154d0035cb0 |
---|---|
32 GtkWidget * MessageBox = NULL; | 32 GtkWidget * MessageBox = NULL; |
33 | 33 |
34 static void on_Ok_released( GtkButton * button,gpointer user_data ) | 34 static void on_Ok_released( GtkButton * button,gpointer user_data ) |
35 { | 35 { |
36 gtk_widget_destroy( MessageBox ); | 36 gtk_widget_destroy( MessageBox ); |
37 MessageBox=NULL; | |
38 } | 37 } |
39 | 38 |
40 static GtkWidget * CreateMessageBox( void ) | 39 static GtkWidget * CreateMessageBox( void ) |
41 { | 40 { |
42 GtkWidget * vbox1; | 41 GtkWidget * vbox1; |
96 Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); | 95 Ok=AddButton( MSGTR_Ok,hbuttonbox1 ); |
97 | 96 |
98 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); | 97 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE ); |
99 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); | 98 gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE ); |
100 | 99 |
101 gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&MessageBox ); | 100 gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&MessageBox ); |
102 gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Ok_released ),NULL ); | 101 gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Ok_released ),NULL ); |
103 | 102 |
104 gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group ); | 103 gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group ); |
105 | 104 |
106 return MessageBox; | 105 return MessageBox; |