Listbox... How to make matches of two, is it possible???
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi everybody!!
I'd like to create two listboxes that scrolls with the same scrollbar... Is it possible?? My aim is to insert two arrays that are related to each other. I can't use cellarrays because of my code...
Can I match two listboxes like two columns of a table??
Or if someone know how to use uitable to set rows and columns starting from arrays length, can you answer here: http://www.mathworks.it/matlabcentral/answers/26624-uitable-how-to-set-number-of-rows-columns ?
0 Commenti
Risposte (2)
Walter Roberson
il 20 Gen 2012
If it could be done to synchronize the scrolling of two listboxes, it would have to be at the Java level. Scrolling does not (as far as I know) create an event that could be used to trigger the transfer of the scroll information to another box.
At any particular point, you can get() or set() the ListBoxTop property, which is the current scrolling amount. You just don't get notified that it has changed. Though I suppose you could waitfor() the property to be changed; I am not sure if that would work, but it might.
If you do not mind an explicit user action to request synchronization, you could set the ButtonDownFcn property of the listbox, which the user would activate by right-clicking (left clicking would be for selecting the entry still); that would give you notice to set the ListBoxTop to be the same.
0 Commenti
Sean de Wolski
il 20 Gen 2012
You could possibly add a post-set listener to the ListBoxTop property that updates the other one whenever the first one is changed.
doc addlistener
2 Commenti
Walter Roberson
il 21 Gen 2012
addlistner gives you an opportunity to have a routine called when an event occurs. The routine you designate would have to check the ListBoxTop of the list being scrolled, and would have to set() the ListBoxTop of the other list.
Vedere anche
Categorie
Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!