Cocoa, SWT.Password and listeners [message #502658] |
Wed, 09 December 2009 10:28 |
Artem Redkin Messages: 26 Registered: July 2009 |
Junior Member |
|
|
I have encountered strange problem in SWT 3.5.1, here's part of the code:
Text text = new Text(fCompositeLogin, SWT.BORDER | SWT.PASSWORD);
GridData data = new GridData(SWT.NONE, SWT.NONE, false, false);
data.widthHint = F_TEXT_WIDTH_HINT;
data.horizontalSpan = 2;
text.setLayoutData(data);
fTextPassword.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.CR || e.keyCode == 16777296) {
e.display.syncExec(new Runnable() {
public void run() {
handleButtonOKWidgetSelected();
}
});
}
}
});
Problem is, that key listener doesn't get called (btw there are other problems with it, like tab key don't change focus). If i remove SWT.PASSWORD style, everything works.
Any comments on this?
|
|
|
Re: Cocoa, SWT.Password and listeners [message #503070 is a reply to message #502658] |
Thu, 10 December 2009 18:40 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
I see this in 3.5.x, but is fixed in the 3.6 stream. I couldn't find a
specific report for it, but I think it became fixed as part of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286763 .
Grant
"Artem Redkin" <artem@redkin.su> wrote in message
news:hfnu44$rr6$1@build.eclipse.org...
> I have encountered strange problem in SWT 3.5.1, here's part of the code:
>
> Text text = new Text(fCompositeLogin, SWT.BORDER | SWT.PASSWORD);
> GridData data = new GridData(SWT.NONE, SWT.NONE, false, false);
> data.widthHint = F_TEXT_WIDTH_HINT;
> data.horizontalSpan = 2;
> text.setLayoutData(data);
>
> fTextPassword.addKeyListener(new KeyAdapter() {
> @Override
> public void keyPressed(KeyEvent e) {
> if (e.keyCode == SWT.CR || e.keyCode == 16777296) {
> e.display.syncExec(new Runnable() {
> public void run() {
> handleButtonOKWidgetSelected();
> }
> });
> }
> }
> });
>
> Problem is, that key listener doesn't get called (btw there are other
problems with it, like tab key don't change focus). If i remove SWT.PASSWORD
style, everything works.
>
> Any comments on this?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03203 seconds