Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TabDeselectedHandler, event.cancel(), SC.say() is inactive for a while

    It is not possible to close the SC alert box when cancelling the TabDeselectedEvent for a few seconds.

    Code:
    	@Override
    	public void onModuleLoad() {
    		TabSet tabSet = new TabSet();
    		
    		Tab tabOne = new Tab("One");
    		Canvas tabOneCanvas = new Canvas();
    		tabOneCanvas.setBackgroundColor("red");		
    		tabOne.setPane(tabOneCanvas);
    		tabOne.addTabDeselectedHandler(new TabDeselectedHandler() {
    			
    			@Override
    			public void onTabDeselected(TabDeselectedEvent event) {
    				SC.say("oh no!");
    				event.cancel();				
    			}
    		});
    		tabSet.addTab(tabOne);
    		
    		Tab tabTwo = new Tab("Two");
    		Canvas tabTwoCanvas = new Canvas();
    		tabTwoCanvas.setBackgroundColor("blue");
    		tabTwo.setPane(tabTwoCanvas);
    		tabSet.addTab(tabTwo);
    		tabTwo.addTabDeselectedHandler(new TabDeselectedHandler() {
    			
    			@Override
    			public void onTabDeselected(TabDeselectedEvent event) {
    				SC.say("oh no two!");
    				event.cancel();
    			}
    		});
    		
    		tabSet.setWidth100();
    		tabSet.setHeight100();
    		tabSet.draw();
    	}
Working...
X