Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 54676 - cannot lock CoolBar too soon
Summary: cannot lock CoolBar too soon
Status: RESOLVED DUPLICATE of bug 14330
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-12 12:11 EST by Grant Gayed CLA
Modified: 2004-03-15 10:58 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2004-03-12 12:11:29 EST
The following snippet attempts but fails to lock the CoolBar, because it does 
so early (right after the CoolBar is created).  However if this line is moved 
down to just before the readAndDispatch loop then it works fine.

public static void main (String [] args) {
	Display display = new Display ();
	Shell shell = new Shell (display);
	CoolBar bar = new CoolBar (shell, SWT.BORDER);
	bar.setLocked(true);	// does not work here
	for (int i=0; i<2; i++) {
		CoolItem item = new CoolItem (bar, SWT.NONE);
	}
	bar.setSize (200, 600);
	shell.open ();
	Button button = new Button (bar, SWT.PUSH);
	button.setText ("FRED");
	button.pack ();
	Point size = button.getSize ();
	CoolItem [] items = bar.getItems ();
	CoolItem item = items [0];
	item.setControl (button);
	item.setSize (item.computeSize (size.x, size.y));
	// if bar.setLocked(true); here then ok
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch ()) display.sleep ();
	}
	display.dispose ();
}
Comment 1 Felipe Heidrich CLA 2004-03-15 10:58:50 EST
I didn't, but very likely this is a dup of 14330.


*** This bug has been marked as a duplicate of 14330 ***