Help - Nested uitogglebutton State Change Callback
古いコメントを表示
In matlab i have a nested uitogglebutton object. like this: fig > uipanel > uigridlayout > uibuttongroup > uitogglebutton. Because the toggle button is contained within uibuttongroup, uitogglebutton callabacks are not allowed. However, uibuttongroup SelectionChangedFcn fires callback if different button within buttongroup is selected and not toggle button state change. (Note: uicontrol with togglebutton not allowed when using uigridlayout). So, how do I detect a uitogglebutton state change and perform callback? Appreciate any help you can provide!
PseudoCode:
fig = figure(...)
panel = uipanel(fig, ...)
grid = uigridlayout(panel, ...)
btngrp = uibuttongroup(grid, ..., 'SelectionChangedFcn',selectionFcn)
tglbtn = uitogglebutton(btngrp, ...) %% callback not allowed on state change
function selectionFcn(src, event) %% Function not executed if togglebutton state change
selectedBtn - src.SelectedObject
if selectedBtn.Value == 1
DoSomething
else
DoSomethingElse
end
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!