How can I create a wxgrid dinamically ?

Kepes Krisztian Kepes.Krisztian at peto.hu
Mon Nov 24 09:45:15 CET 2003


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






More information about the Python-list mailing list