📄 test_listbox_callback.m
字号:
function test_listbox_callback(action)
switch action
case 'button'
Hndl = findobj(gcbf,'Tag','Listbox1');
value = get (Hndl,'Value');
Hndl = findobj(gcbf,'Tag','Label1');
str = ['Option ' num2str(value)];
set (Hndl,'String',str);
case 'list'
% If this was a double click, update the label.
selectiontype = get(gcf,'SelectionType');
if selectiontype(1) == 'o'
Hndl = findobj(gcbf,'Tag','Listbox1');
value = get (Hndl,'Value');
Hndl = findobj(gcbf,'Tag','Label1');
str = ['Option ' num2str(value)];
set (Hndl,'String',str);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -