I see lots of examples of grids that look like this ...
wxGrid *grid = new wxGrid(...);
grid->CreateGrid(...);
grid->SetColLabelValue(...);
Is there a way for me to subclass the grid and initialize it from within the
grid itself?
Like, when I create a wxNotebook, I just subclass wxNotebook as MyNotebook
and then add the tabs within the constructor.
But I can't do this in wxGrid because wxGrid::CreateGrid() needs to be
called first.
Is there an OnInit()-like event for the wxGrid where I can move its initial
setup code?
Thanks for any help.
I'm using wxListCtrl now, instead of wxGrid. It was sufficient and I'm able
to subclass it and populate the control within the initializer which is what
I was looking for.
"Willy Wankalot" <willyw...@earthlink.net> wrote in message
news:QYGdncbyXrzZr8_X...@earthlink.com...
> Is there a way for me to subclass the grid and initialize it from within the
> grid itself?
> But I can't do this in wxGrid because wxGrid::CreateGrid() needs to be
> called first.
You can call CreateGrid() from the constructor of your subclass. (The
constructor of the base class is executed before the constructor of the
subclass is called.)
> Is there an OnInit()-like event for the wxGrid where I can move its initial
> setup code?
Why not inside the constructor?
greetings
Joachim
--
Dr. Joachim Wiesemann
http://www.bestviewed.de/ Seiten �ber Webdesign und Usability
http://jwiesemann.com/ Ingenieurdienstleistungen, Usabilityberatung
"Die sch�rfsten Kritiker der Elche waren fr�her selber welche!"
"Joachim Wiesemann" <newsant...@jwiesemann.de> wrote in message
news:1gbukhgfrqpfg.i...@40tude.net...
=>