Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » SelectionListener on Buttons type SWT.RADIO
SelectionListener on Buttons type SWT.RADIO [message #660248] Thu, 17 March 2011 14:34 Go to next message
NkD Missing name is currently offline NkD Missing nameFriend
Messages: 61
Registered: July 2009
Member
Snippet:

Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
SelectionListener selectionListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Button btn = (Button) e.getSource();
System.out.println("Event on '" + btn.getText() + "' -
selection = " + btn.getSelection());
}
};
Button btn1 = new Button(composite, SWT.RADIO);
btn1.setText("Button 1");
btn1.addSelectionListener(selectionListener);
Button btn2 = new Button(composite, SWT.RADIO);
btn2.setText("Button 2");
btn2.addSelectionListener(selectionListener);
btn1.setSelection(true);

When run this snippet and click to Button 2 then becomes:

Event on 'Button 1' - selection = false
Event on 'Button 2' - selection = true

but I expect only:

Event on 'Button 2' - selection = true

Is it feature or bug ?
Re: SelectionListener on Buttons type SWT.RADIO [message #660249 is a reply to message #660248] Thu, 17 March 2011 14:37 Go to previous messageGo to next message
NkD Missing name is currently offline NkD Missing nameFriend
Messages: 61
Registered: July 2009
Member
Ouch... I forget: I use RAP 1.4 M5+ (exactly cvs head from 17.3.2011)
Re: SelectionListener on Buttons type SWT.RADIO [message #660251 is a reply to message #660249] Thu, 17 March 2011 14:45 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Michal,
this is the exact SWT behavior.
Best,
Ivan

On 3/17/2011 4:37 PM, Michal NkD Nikodím wrote:
> Ouch... I forget: I use RAP 1.4 M5+ (exactly cvs head from 17.3.2011)
Previous Topic:wrong MD5 with latest 1.4.0 runtime
Next Topic:Accessing properties file through jar
Goto Forum:
  


Current Time: Sun Oct 17 14:10:40 GMT 2021

Powered by FUDForum. Page generated in 0.02108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top