GUIDE: Updating table rows depending on popup user choice
1 次查看(过去 30 天)
显示 更早的评论
Dear all; this is the first time I'm using guide so this may be a really stupid question, sorry about that!
I have a popup and a table. Depending on what's the user choice in the popup, the RowName properties for the table changes. Once I'll have managed this one, then I need to add a second set of table+ popup and do exactly the same thing.
How would you accomplish that? I'm having troubles with this especially because of the nested functions I guess....
Thanks everybody!
0 个评论
采纳的回答
Tom
2013-6-26
Set this for the popupmenu callback.
In the CreateFcn callback of the popupmenu, you can add some options, e.g.
set(hObject,'String',{'Option 1','Option 2'})
In the Callback of the popupmenu you can then change the table's row names based on the popupmenu selection:
val = get(hObject,'Value');
if val == 1
set(handles.uitable1,'RowName',{'One','Two','Three'})
elseif val == 2
set(handles.uitable1,'RowName',{'Alpha','Beta','Gamma'})
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!