How can I create a wxgrid dinamically ?

K

Kepes Krisztian

Hi !

My problem is that:

1.)

I want to create a frame with some buttons, and client area.
If the user clicked on a button, the procedure create components on
client area, and show results.

The components are not same classes, some grids, some others.

But I cannot do that.

If i do like this:

def OnClick2(self,event):
g=wxGrid(self, -1) # new grid
g.CreateGrid(10,10)
g.Show(1)
self.mainsizer.Add(g, 0, wxALL|wxEXPAND, 8) # I want to show
#self.mainsizer.Fit(self)
self.SetSizer(self.mainsizer)
self.mainsizer.SetSizeHints()


.... but it is nothing happened.

How can I create components dinamically, and how can I show ?

2.)
How can I clear the grid to I can recreate with CreateGrid ?
Or I can do only DeleteRows/Cols and InsertRows/Cols ?


Thanx for help:
KK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top