* 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>
*
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 );