Allow GUI to show a different table whenever the popup menu is accessed.

1 回表示 (過去 30 日間)
Darren Koh
Darren Koh 2018 年 3 月 7 日
コメント済み: Darren Koh 2018 年 3 月 13 日
Hi there, I have tried doing this but it does not seem to display anything when i select a value from the popup menu. Is there a way to do this? Furthermore, do i place the tables in the same position (overlapping one another) if i want it to appear in the same place when i access the popup menu? Thank you
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
items = get(hObject,'String');
index_selected = get(hObject,'Value');
item_selected = items{index_selected};
display(item_selected);
uitable(handles.uitable(index_selected));
cla;

採用された回答

Jan
Jan 2018 年 3 月 9 日
編集済み: Jan 2018 年 3 月 9 日
You can disable the visibility of the other uitable objects:
set(handles.uitable, 'Visible', 'off);
set(handles.uitable(index_selected), 'Visible', 'on');
Instead of creating a bunch of uitable objects, it might be more efficient to create one table only and modify the 'Data' property only.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by