Scroll bar and MouseEnteredCallback
Show older comments
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
Answers (0)
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!