Scroll bar and MouseEnteredCallback
显示 更早的评论
I apologize in advance for my English. Events are triggered only when you hover over a listbox, but do not work when you hover over the scroll bar. How can I fix this?
function primer()
simFigure = figure(123);
set(simFigure, 'Name', 'Simulation', 'NumberTitle','off');
set(simFigure, 'Units','norm', 'Position', [0 0 1 1]);
set(simFigure, 'RendererMode', 'manual');
set(simFigure, 'Renderer', 'zbuffer');
set(simFigure, 'Color', [0.941 0.941 0.941]);
listParWork = uicontrol('Style', 'listBox', 'Units','norm', 'Position',[0.068 0.71 0.12473 0.07978],...
'FontSize',8, 'Tag', 'parWork', 'Parent', simFigure);
jButton = findjobj(listParWork);
jListbox = jButton.getViewport.getView;
jListbox = handle(jListbox, 'CallbackProperties');
set(jListbox,'MouseEnteredCallback', {@enterListPar,listParWork});
set(jListbox,'MouseExitedCallback', {@exitListPar,listParWork});
end
function enterListPar(~,~,list)
set(list, 'Position', [0.068 0.63 0.12473 0.15978]);
end
function exitListPar(~,~,list)
set(list, 'Position', [0.068 0.71 0.12473 0.07978]);
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!