]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/MessagesWindow.cpp
Changes done since Feb 28 2003:
[vlc] / modules / gui / beos / MessagesWindow.cpp
index 3a52237212663d0553bf75cc50b74de92b5f00b1..af9d8be88d019392a4a4c0877b71f5d2fbedf3af 100644 (file)
@@ -2,7 +2,7 @@
  * MessagesWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: MessagesWindow.cpp,v 1.3 2003/01/28 08:17:26 titer Exp $
+ * $Id: MessagesWindow.cpp,v 1.6 2003/02/01 12:01:11 stippi Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -147,28 +147,28 @@ void MessagesWindow::UpdateMessages()
                 case VLC_OBJECT_SOUT: psz_module_type = "stream output"; break;
             }
             
-            fMessagesView->LockLooper();
-            oldLength = fMessagesView->TextLength();
-            BString string;
-            string.Append( p_sub->p_msg[i_start].psz_module );
-            string.Append( " " );
-            string.Append( psz_module_type );
-            string.Append( " : " );
-            string.Append( p_sub->p_msg[i_start].psz_msg );
-            string.Append( "\n" );
-            fMessagesView->Insert( string.String() );
-            fMessagesView->SetFontAndColor( oldLength,
-                                            fMessagesView->TextLength(),
-                                            NULL, 0, &color );
-            fMessagesView->Draw( fMessagesView->Bounds() );
-            fMessagesView->UnlockLooper();
+            if ( fMessagesView->LockLooper() )
+            {
+                   oldLength = fMessagesView->TextLength();
+                   BString string;
+                   string << p_sub->p_msg[i_start].psz_module << " " << psz_module_type << " : " <<
+                       p_sub->p_msg[i_start].psz_msg << "\n";
+                   fMessagesView->Insert( string.String() );
+                   fMessagesView->SetFontAndColor( oldLength,
+                                                   fMessagesView->TextLength(),
+                                                   NULL, 0, &color );
+                   fMessagesView->Draw( fMessagesView->Bounds() );
+                   fMessagesView->UnlockLooper();
+            }
             
             /* Scroll at the end */
-            fScrollBar->LockLooper();
-            float min, max;
-            fScrollBar->GetRange( &min, &max );
-            fScrollBar->SetValue( max );
-            fScrollBar->UnlockLooper();
+            if( fScrollBar->LockLooper() )
+            {
+                float min, max;
+                fScrollBar->GetRange( &min, &max );
+                fScrollBar->SetValue( max );
+                fScrollBar->UnlockLooper();
+            }
         }
 
         vlc_mutex_lock( p_sub->p_lock );