Community
Participate
Working Groups
The text widget does not fire modify events if it was created with the READ_ONLY style flag and made editable later on. To reproduce, * run the code below * click on the "Make editable" button * then type into the text widget => no modify events are sent public int createUI() { Display display = new Display(); Shell shell = new Shell(); shell.setLayout(new RowLayout()); final Text text = new Text( shell, SWT.BORDER | SWT.READ_ONLY ); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { System.out.println( "ModifyEvent: " + event ); } }); Button button = new Button( shell, SWT.PUSH); button.setText("Make editable"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { text.setEditable(true); } }); shell.pack(); shell.open(); while(!shell.isDisposed()){ if( !display.readAndDispatch()){ display.sleep(); } } return 0; }
The problem was in TextUtilLCA#writeVerifyAndModifyListener, where the property "hasVerifyOrModifyListener" was not written on the client in case of READ_ONLY style flag. Fixed in CVS HEAD.