Get crazy with wxGrid
Milan Babuskov
milanb at panonnet.net
Fri Dec 21 01:21:34 PST 2007
YAP wrote:
> No other component in my life have cause more headache than the wxGrid
> in my +25 years as a programmer.
Makes one wonder what did you program in during 1982 that didn't give
you much headache. ;)
> Now a couple o days before a planed a
> release I discovered that AppendRows even with an underling grid table
> add rows to the wxGrid itself and by that taking away the hole idea
> with the gridtable.
>
> So how is it used. Does anyone have a real world example?
Yes. Can't get more real than this. Here the code:
http://flamerobin.svn.sourceforge.net/viewvc/flamerobin/trunk/flamerobin/src/gui/controls/
To see the files, click on numbers in Rev. column.
And here's the end result:
http://www.flamerobin.org
> Or is it so bad that I have to set the number of rows of the grid at
> the construction time for the wxGrid.
You just have to let wxGrid know the number of rows as it wouldn't know
what is can render, how big are scrollbars, etc. Even if you have
'infinite' virtual dataset you can always tell wxGrid how much of it you
'know'.
For example, we fetch data from databases. It can be millions of
records. We just fetch 300 at a time and tell wxGrid those 300 are
available. Once wxGrid starts requesting those near the bottom (records
200-300) we just fetch another 300 and send a wxGridTableMessage that
number of rows has increased.
--
Milan Babuskov
http://www.flamerobin.org
More information about the wx-users
mailing list