resize event only called once???? [message #447843] |
Sat, 18 December 2004 00:57 |
Eclipse User |
|
|
|
Originally posted by: gopowereclipse.yahoo.com
I customized a dialog to allow resizing and registered a listener to watch
for RESIZE events. The event handler is only invoked once when the dialog is
coming up. When I resize the dialog with the mouse, the event never gets
triggered any more. If try to register the RESIZE listener in any control
that is hosted in the dialog, the controls' resize handler never gets
called, either. Does someone know why this is happening? Did I do something
wrong? Thanks a lot for your help.
--Vivian
================================================
import org.eclipse.jface.dialogs.Dialog;
public class MyDialog extends Dialog
{
public MyDialog(Shell parentShell)
{
super(parentShell);
setShellStyle(getShellStyle() | SWT.RESIZE); <== allow resizing
}
protected void configureShell(Shell shell)
{
super.configureShell(shell);
shell.setText(TITLE);
shell.addListener(SWT.RESIZE, new Listener (){
public void handleEvent (Event event)
{
int width = getShell().getClientArea().width; <== only hit
once during the dialog open
...
}
});
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02605 seconds