I am using wxScrolledWindow
to display data(in rows and columns form). For example, I have 4 columns and around 1200 rows(all of which have the same height). Say first column represents name, 2nd column represents phone number, and so on. This works well but the problem is that since i've added all the 1200 rows into the wxScrolledWindow
the program is consuming large amount of memory.
So, I want that only the rows that are visible to the user should be present at a given time inside the wxScrollWindow
and when the user starts scrolling the other rows should be dynamically created. After searching for this I came to know that this is called virtual scrolling and wxWidgets
offers this in wxListCtrl
using the wxLC_VIRTUAL
style. But the problem with this is that i cannot customize the appearance of wxListCtrl
. For example, say the 3rd column in my custom scrollist contains a button with some text and the 4th column contains some wxStaticText
and i want to change the height, background colour of each row meanwhile maintaining virtual scrolling.
So my questions are:
Is there some documentation where i can read the theory of virtual scrolling(on which
wxListCtrl
's virtual scroll was based on) so that i can implement it by myself. Note that i have read the github repo of wxWidgets but from there i couldn't figure out and also i feel the the documentation there is lacking.Is there a working demo of implementing virtual scrolling in wxwidgets for a
wxScrollWindow
or for any other window. I mean just so that I can use it as a reference and starting point.
PS: I have searched the web for the same but couldn't find any post that shows how we can implement virtual scrolling in wxwidgets so I decided to ask It myself.