Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Cocoa, SWT.Password and listeners
Cocoa, SWT.Password and listeners [message #502658] Wed, 09 December 2009 05:28 Go to next message
Artem Redkin is currently offline 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 13:40 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
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?
Re: Cocoa, SWT.Password and listeners [message #503078 is a reply to message #503070] Thu, 10 December 2009 09:28 Go to previous message
Artem Redkin is currently offline Artem Redkin
Messages: 26
Registered: July 2009
Junior Member
Grant Gayed wrote on Thu, 10 December 2009 13:40
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 .


Spend half of the day looking for that kind of bug, but was looking for 'listener' keyword Smile). Thanks for pointing out!

[Updated on: Thu, 10 December 2009 09:29]

Report message to a moderator

Previous Topic:set Column width to show complete text
Next Topic:Set scrollbar selection
Goto Forum:
  


Current Time: Mon Apr 21 00:39:38 EDT 2014

Powered by FUDForum. Page generated in 0.01864 seconds