summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-02 15:48:29 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-02 15:48:29 +0000
commitea631b6c187b127e8bfd57abf5f9a04237f6524f (patch)
tree500c4c9eb079a5f4bebc644b1ae1f60b825f26b9
parent4cc8c41392c6b291ea2062631319e3db5a7166d2 (diff)
downloadmpv-ea631b6c187b127e8bfd57abf5f9a04237f6524f.tar.bz2
mpv-ea631b6c187b127e8bfd57abf5f9a04237f6524f.tar.xz
correct widget destroy event handler (thank for D J Hawkey Jr <hawkeyd@visi.com>)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8720 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--Gui/mplayer/gtk/about.c7
-rw-r--r--Gui/mplayer/gtk/common.c8
-rw-r--r--Gui/mplayer/gtk/common.h1
-rw-r--r--Gui/mplayer/gtk/eq.c4
-rw-r--r--Gui/mplayer/gtk/fs.c2
-rw-r--r--Gui/mplayer/gtk/mb.c2
-rw-r--r--Gui/mplayer/gtk/opts.c8
-rw-r--r--Gui/mplayer/gtk/pl.c2
-rw-r--r--Gui/mplayer/gtk/sb.c2
-rw-r--r--Gui/mplayer/gtk/url.c2
10 files changed, 25 insertions, 13 deletions
diff --git a/Gui/mplayer/gtk/about.c b/Gui/mplayer/gtk/about.c
index 1caaa81782..b0dfc05604 100644
--- a/Gui/mplayer/gtk/about.c
+++ b/Gui/mplayer/gtk/about.c
@@ -17,6 +17,9 @@ void ShowAboutBox( void )
gtk_widget_show( About );
}
+void abWidgetDestroy( GtkWidget * widget,GtkWidget ** widget_pointer )
+{ WidgetDestroy( NULL,&About ); }
+
GtkWidget * create_About( void )
{
GtkWidget * vbox;
@@ -144,8 +147,8 @@ GtkWidget * create_About( void )
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 );
diff --git a/Gui/mplayer/gtk/common.c b/Gui/mplayer/gtk/common.c
index a021cfde79..721f1f1ad4 100644
--- a/Gui/mplayer/gtk/common.c
+++ b/Gui/mplayer/gtk/common.c
@@ -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;
diff --git a/Gui/mplayer/gtk/common.h b/Gui/mplayer/gtk/common.h
index 6aecc11dc5..e0bdc29c73 100644
--- a/Gui/mplayer/gtk/common.h
+++ b/Gui/mplayer/gtk/common.h
@@ -18,5 +18,6 @@ extern GtkWidget * AddHButtonBox( GtkWidget * parent );
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
diff --git a/Gui/mplayer/gtk/eq.c b/Gui/mplayer/gtk/eq.c
index d97b838f0c..b961765a24 100644
--- a/Gui/mplayer/gtk/eq.c
+++ b/Gui/mplayer/gtk/eq.c
@@ -443,7 +443,7 @@ GtkWidget * create_Equalizer( void )
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 @@ GtkWidget * create_EquConfig( void )
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 );
diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c
index 2f70ebba7c..2f9a68b662 100644
--- a/Gui/mplayer/gtk/fs.c
+++ b/Gui/mplayer/gtk/fs.c
@@ -702,7 +702,7 @@ GtkWidget * create_FileSelect( void )
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 );
diff --git a/Gui/mplayer/gtk/mb.c b/Gui/mplayer/gtk/mb.c
index 9c83a68748..ebcb8b6098 100644
--- a/Gui/mplayer/gtk/mb.c
+++ b/Gui/mplayer/gtk/mb.c
@@ -88,7 +88,7 @@ GtkWidget * create_MessageBox( int type )
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 );
diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c
index d0a1107a79..1a78559f5c 100644
--- a/Gui/mplayer/gtk/opts.c
+++ b/Gui/mplayer/gtk/opts.c
@@ -1063,7 +1063,7 @@ GtkWidget * create_Preferences( void )
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 @@ GtkWidget * create_OSSConfig( void )
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 @@ GtkWidget * create_SDLConfig( void )
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 @@ GtkWidget * create_DXR3Config( void )
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 );
diff --git a/Gui/mplayer/gtk/pl.c b/Gui/mplayer/gtk/pl.c
index a6fc939c8f..0178ea1375 100644
--- a/Gui/mplayer/gtk/pl.c
+++ b/Gui/mplayer/gtk/pl.c
@@ -508,7 +508,7 @@ GtkWidget * create_PlayList( void )
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 );
diff --git a/Gui/mplayer/gtk/sb.c b/Gui/mplayer/gtk/sb.c
index 01327cc0ff..3a712ce950 100644
--- a/Gui/mplayer/gtk/sb.c
+++ b/Gui/mplayer/gtk/sb.c
@@ -175,7 +175,7 @@ GtkWidget * create_SkinBrowser( void )
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 );
diff --git a/Gui/mplayer/gtk/url.c b/Gui/mplayer/gtk/url.c
index 38ef066461..b274b6c004 100644
--- a/Gui/mplayer/gtk/url.c
+++ b/Gui/mplayer/gtk/url.c
@@ -137,7 +137,7 @@ GtkWidget * create_URL( void )
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 );