views:

32

answers:

1

Hi,

I have some problem with button withs flag SWT.RADIO;

What i want to is to prevent the change of some button in some circumstances

case scenario

We have three buttons, on selection change the system verifies that this is allowed. if not then we don want to set new selection.

So what the real problem, i am operating on selection listener. When we change the selection the listener is fired twice; first to hide selection of other item and then selection for current selected button.

I there a way to do this simply, or normal ?

A: 

Manually undoing selection is not a good idea. You should be able to disable selection by setting event.doit = false inside selection listener. You can ignore one of the callbacks by checking the selection state of ((Button) event.source).getSelection())

Mohsen
@Mohsen, the event.doit = false in this case do not work.
Vash