PDA

View Full Version : [FIXED] MessageBox fails with exception B5



plitvak
20 Jun 2008, 8:05 AM
Here is the code, line in bold where it fails.


private void testMessageBox( LayoutContainer mainContainer )
{
ToolBar toolBar = new ToolBar();
TextToolItem logoutBtn = new TextToolItem( "Logout" );
logoutBtn.addSelectionListener( new LogoutSelectionListener() );

toolBar.add( logoutBtn );

mainContainer.add( toolBar );
}

private class LogoutSelectionListener extends SelectionListener<ComponentEvent>
{
@Override
public void componentSelected( ComponentEvent ce )
{
final Listener l = new Listener<WindowEvent>()
{
public void handleEvent( WindowEvent we)
{
Button btn = ((Dialog)we.component).getButtonPressed();
if( btn.getItemId() == Dialog.YES )
{
Window.alert( "logged out!" );
}
}
};

MessageBox question = new MessageBox();
question.setIcon( MessageBox.QUESTION );
question.setButtons( MessageBox.YESNO );
question.setModal( true );
question.setTitle( "Logout" );
question.setMessage( "Logout?" );
question.addCallback( l );
question.show();
}
}

darrellmeyer
20 Jun 2008, 8:23 AM
This is fixed in SVN.