Controlling the scroll position of a uitable
Show older comments
Hello
I had a uitable which I decided to split in two, because of its size. Therefore, I want to synchronize the vertial scroll position of both tables, that is, if I scroll down on one table, the other should scroll down by the same amount.
Breaking it down, what I need to do is (for each table): 1) Trigger a callback when the vertical scroll position is changed. 2) Read the current scroll position 3) Set the scroll posiiton of the second table.
However, I can't figure out how to do this, either through native MAtlab or through the Java handle.
Answers (2)
Walter Roberson
on 21 Dec 2012
2 votes
Unfortunately this is not possible, unless it can be done through Java.
The closest you can get to this is to place an object on its own uipanel(); then by changing the Position of the object you can move it around relative to the frame that is the uipanel border. By using linkprop() you can make the Position of the two uitable (each in their own uipanel) the same. You can add a scrollbar outside of either of the two uipanel that you can use to choose the Position.
This is certainly not as nice as using the scrollbars that uipanel automatically provides, but unfortunately there is no documented way to find out what part of the uipanel is currently visible when you use the built-in scrolling.
Eyal Fleminger
on 21 Dec 2012
0 votes
Categories
Find more on Construct and Work with Object Arrays 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!