PDA

View Full Version : [FNR] Window.setMinimizable() widget not rendering



connysvensson
20 May 2008, 1:21 AM
I had a problem with events not firing on the minimize action for windows in beta 2. Now in beta 3 the minimize widget doesn't even render. I looked at the code for beta 2 and saw the problem why the event wasn't fired, the minimize widget was created twice in the initTools method.
In beta 3 there seems to have been some cleanup but the important addTool method call is missing, which nevers adds the minimize widget to the window chrome.

Here is the code snippet in the initTools method in the Window class for dealing with the minimize widget:

if (minimizable) {
minBtn = new ToolButton("x-tool-minimize");
minBtn.addSelectionListener(new SelectionListener() {
public void componentSelected(ComponentEvent ce) {
minimize();
}
});
}Missing the following line in the end:
head.addTool(minBtn);

darrellmeyer
20 May 2008, 9:46 AM
I added the missing line and also put the minimize button before the maximize button. Fix is in SVN.