changeset 8719:dc27303ae528

correct widget destroy event handler (thank for D J Hawkey Jr <hawkeyd@visi.com>)
author pontscho
date Thu, 02 Jan 2003 15:48:29 +0000
parents d630a6f4c7c0
children 5546fe9dfa06
files Gui/mplayer/gtk/about.c Gui/mplayer/gtk/common.c Gui/mplayer/gtk/common.h Gui/mplayer/gtk/eq.c Gui/mplayer/gtk/fs.c Gui/mplayer/gtk/mb.c Gui/mplayer/gtk/opts.c Gui/mplayer/gtk/pl.c Gui/mplayer/gtk/sb.c Gui/mplayer/gtk/url.c
diffstat 10 files changed, 25 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/gtk/about.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/about.c	Thu Jan 02 15:48:29 2003 +0000
@@ -17,6 +17,9 @@
  gtk_widget_show( About );
 }
 
+void abWidgetDestroy( GtkWidget * widget,GtkWidget ** widget_pointer )
+{ WidgetDestroy( NULL,&About ); }
+
 GtkWidget * create_About( void )
 {
   GtkWidget     * vbox;
@@ -144,8 +147,8 @@
   AddHSeparator( vbox );
   Ok=AddButton( MSGTR_Ok,AddHButtonBox( vbox ) );
 
-  gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&About );
-  gtk_signal_connect_object( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( gtk_widget_destroy ),GTK_OBJECT( About ) );
+  gtk_signal_connect( GTK_OBJECT( About ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&About );
+  gtk_signal_connect_object( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( abWidgetDestroy ),NULL );
 
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
--- a/Gui/mplayer/gtk/common.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/common.c	Thu Jan 02 15:48:29 2003 +0000
@@ -4,6 +4,14 @@
 
 #include "common.h"
 
+void WidgetDestroy( GtkWidget * widget,GtkWidget ** widget_pointer )
+{
+ if ( !widget_pointer ) return;
+ gtk_widget_hide( *widget_pointer );
+ gtk_widget_destroy( *widget_pointer );
+ *widget_pointer=NULL;
+}
+
 GtkWidget * AddDialogFrame( GtkWidget * parent )
 {
  GtkWidget * frame;
--- a/Gui/mplayer/gtk/common.h	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/common.h	Thu Jan 02 15:48:29 2003 +0000
@@ -18,5 +18,6 @@
 extern GtkWidget * AddHScaler( GtkAdjustment * adj,GtkWidget * parent,int digit );
 extern GtkWidget * AddVScaler( GtkAdjustment * adj,GtkWidget * parent,int digit );
 extern GtkWidget * AddComboBox( GtkWidget * parent );
+extern void WidgetDestroy( GtkWidget * widget,GtkWidget ** widget_pointer );
 
 #endif
--- a/Gui/mplayer/gtk/eq.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/eq.c	Thu Jan 02 15:48:29 2003 +0000
@@ -443,7 +443,7 @@
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Equalizer );
+  gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&Equalizer );
   gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus_in_event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 );
 
   gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select_row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL );
@@ -661,7 +661,7 @@
   gtk_widget_add_accelerator( ecOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( ecCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&EquConfig );
+  gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&EquConfig );
   
   gtk_signal_connect( GTK_OBJECT( ecOk ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)1 );
   gtk_signal_connect( GTK_OBJECT( ecCancel ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)0 );
--- a/Gui/mplayer/gtk/fs.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/fs.c	Thu Jan 02 15:48:29 2003 +0000
@@ -702,7 +702,7 @@
  fsOk=AddButton( MSGTR_Ok,hbuttonbox3 );
  fsCancel=AddButton( MSGTR_Cancel,hbuttonbox3 );
 
- gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&fsFileSelect );
+ gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&fsFileSelect );
  gtk_signal_connect( GTK_OBJECT( fsFileSelect ),"key_release_event",GTK_SIGNAL_FUNC( on_FileSelect_key_release_event ),NULL );
 
  gtk_signal_connect( GTK_OBJECT( fsFilterCombo ),"changed",GTK_SIGNAL_FUNC( fs_fsFilterCombo_changed ),fsFilterCombo );
--- a/Gui/mplayer/gtk/mb.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/mb.c	Thu Jan 02 15:48:29 2003 +0000
@@ -88,7 +88,7 @@
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&MessageBox );
+ gtk_signal_connect( GTK_OBJECT( MessageBox ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&MessageBox );
  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Ok_released ),NULL );
 
  gtk_window_add_accel_group( GTK_WINDOW( MessageBox ),accel_group );
--- a/Gui/mplayer/gtk/opts.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/opts.c	Thu Jan 02 15:48:29 2003 +0000
@@ -1063,7 +1063,7 @@
   gtk_widget_add_accelerator( BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
   gtk_widget_add_accelerator( BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Preferences );
+  gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&Preferences );
   
   gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig );
   gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bOk );
@@ -1238,7 +1238,7 @@
   BOssOk=AddButton( MSGTR_Ok,hbuttonbox6 );
   BOssCancel=AddButton( MSGTR_Cancel,hbuttonbox6 );
 
-  gtk_signal_connect( GTK_OBJECT( OSSConfig ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&OSSConfig );
+  gtk_signal_connect( GTK_OBJECT( OSSConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&OSSConfig );
   
   gtk_signal_connect( GTK_OBJECT( BOssOk ),"clicked",GTK_SIGNAL_FUNC( ossButton ),(void*)1 );
   gtk_signal_connect( GTK_OBJECT( BOssCancel ),"clicked",GTK_SIGNAL_FUNC( ossButton ),(void*)0 );
@@ -1349,7 +1349,7 @@
   BSDLOk=AddButton( MSGTR_Ok,hbuttonbox6 );
   BSDLCancel=AddButton( MSGTR_Cancel,hbuttonbox6 );
 
-  gtk_signal_connect( GTK_OBJECT( SDLConfig ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&SDLConfig );
+  gtk_signal_connect( GTK_OBJECT( SDLConfig ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&SDLConfig );
   
   gtk_signal_connect( GTK_OBJECT( BSDLOk ),"clicked",GTK_SIGNAL_FUNC( sdlButton ),(void*)1 );
   gtk_signal_connect( GTK_OBJECT( BSDLCancel ),"clicked",GTK_SIGNAL_FUNC( sdlButton ),(void*)0 );
@@ -1497,7 +1497,7 @@
  gtk_widget_add_accelerator( dxr3BOk,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( dxr3BCancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&DXR3Config );
+ gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&DXR3Config );
  
  gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 );
  gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 );
--- a/Gui/mplayer/gtk/pl.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/pl.c	Thu Jan 02 15:48:29 2003 +0000
@@ -508,7 +508,7 @@
 
   gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
-  gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&PlayList );
+  gtk_signal_connect( GTK_OBJECT( PlayList ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&PlayList );
 
   gtk_signal_connect( GTK_OBJECT( CLFiles ),"select_row",GTK_SIGNAL_FUNC( plRowSelect ),(void *)0 );
   gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect_row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void *)0 );
--- a/Gui/mplayer/gtk/sb.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/sb.c	Thu Jan 02 15:48:29 2003 +0000
@@ -175,7 +175,7 @@
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&SkinBrowser );
+ gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&SkinBrowser );
  gtk_signal_connect( GTK_OBJECT( SkinList ),"select_row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 );
  gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 );
--- a/Gui/mplayer/gtk/url.c	Thu Jan 02 15:38:26 2003 +0000
+++ b/Gui/mplayer/gtk/url.c	Thu Jan 02 15:48:29 2003 +0000
@@ -137,7 +137,7 @@
  gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
  gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
 
- gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&URL );
+ gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&URL );
  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),(void *)1 );
  gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),NULL );