]> git.sesse.net Git - vlc/commitdiff
fix play/pause button state ... gruiiiikkk
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 15 May 2005 18:04:32 +0000 (18:04 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 15 May 2005 18:04:32 +0000 (18:04 +0000)
Closes #2

modules/gui/wxwindows/interface.cpp

index 505b8ceb7dae64a0d31eb725e5c319895f649cb4..faddc191f92448e365773eb032dab058d84ec60a 100644 (file)
@@ -1259,17 +1259,19 @@ void Interface::TogglePlayButton( int i_playing_status )
         GetToolBar()->GetToolClientData( PlayStream_Event );
     if( !p_tool ) return;
 
+    GetToolBar()->DeleteTool( p_tool->GetId() );
+
     if( i_playing_status == PLAYING_S )
     {
-        p_tool->SetNormalBitmap( wxBitmap( pause_xpm ) );
-        p_tool->SetLabel( wxU(_("Pause")) );
-        p_tool->SetShortHelp( wxU(_(HELP_PAUSE)) );
+        p_tool = GetToolBar()->InsertTool(2, PlayStream_Event, wxT(""),
+                      wxBitmap( pause_xpm ), wxU(_(HELP_PAUSE)) );
+        p_tool->SetClientData( p_tool );
     }
     else
     {
-        p_tool->SetNormalBitmap( wxBitmap( play_xpm ) );
-        p_tool->SetLabel( wxU(_("Play")) );
-        p_tool->SetShortHelp( wxU(_(HELP_PLAY)) );
+        p_tool = GetToolBar()->InsertTool(2, PlayStream_Event, wxT(""),
+                      wxBitmap( play_xpm ), wxU(_(HELP_PLAY)) );
+        p_tool->SetClientData( p_tool );
     }
 
     GetToolBar()->Realize();