Hopefully simple UIButtonGroup question

I created a UIButtonGroup and instantiated several radiobuttons. I'm using the SelectionChangeFcn callback properly for the radiobuttons and it works as expected except for an annoying issue.
When I click on a button, I want it to do something, which it does the first time I click that button. If that button is already selected and I want to repeat that action I should just click on that same button again...right? Wrong. Once that button is selected, I have to click on another button in the group then select the previously selected button. I basically want the callback to fire if I select the same button over and over again.
Any ideas? Thanks, Jason

 採用された回答

Milos
Milos 2012 年 11 月 7 日

0 投票

After the code execution set off by pushing a radio button, add the code:
set(get(handles.uipanel1, 'SelectedObject'), 'Value', 0);
From a user interface point, it looks like you would be better served by plain old push buttons. Radio buttons in a panel operate like switches - once it's on, to come back to "on" state, it has to be in "off" state first.

その他の回答 (1 件)

Christine
Christine 2012 年 11 月 7 日

0 投票

You could try to set the Value-property of your button to 'Min' at the end of the routine it is running:
set(handel,'Value','Min');
Such it should be ready to be pressed again after it did his job.

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

質問済み:

2012 年 11 月 7 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by