Bug 4451

Summary: Shell: setDefaultButton, default button cannot be reset to null (1FGLS6M)
Product: [Eclipse Project] Platform Reporter: Mike Wilson <Mike_Wilson>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P4    
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: Windows All   
Whiteboard:

Description Mike Wilson CLA 2001-10-11 14:17:00 EDT
Execute the following:

Shell shell = new Shell();
Button button = new Button(shell, SWT.NULL);
shell.setDefaultButton(button);
shell.setDefaultButton(null);
shell.getDefaultButton();

getDefaultButton returns button when I expect it to return null

The SWT decoration code looks suspect.

NOTES:

	McQ (10/10/2000 3:20:09 PM) -
		SN to explain what is going on here.

SN (8/7/01 11:21:14 AM)
	Setting the default button to "null" clears the current default
	button and causes it to snap back.  To see this kind of behavior in a 
native
	widget, bring up the file dialog, stroke the 'cancel' button and then 
click on a
	file.  The default button snaps back to the 'open' button.

	What we should do (easy fix) is to make setting the default button 
to 'null' twice
	clear the saved default.  Also, we could add API to set/clear the saved 
deafult
	button.  The first way is a bit ugly but requires no new API.
Comment 1 DJ Houghton CLA 2001-10-24 06:29:03 EDT
PRODUCT VERSION:

	0.27b

Comment 2 Steve Northover CLA 2002-07-05 13:46:27 EDT
Fixed > 20020705
Comment 3 Steve Northover CLA 2002-07-05 13:48:51 EDT
Fixed > 20020705