Bug 4451 - Shell: setDefaultButton, default button cannot be reset to null (1FGLS6M)
Summary: Shell: setDefaultButton, default button cannot be reset to null (1FGLS6M)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Windows All
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-11 14:17 EDT by Mike Wilson CLA
Modified: 2002-07-05 13:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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