Dyna grid

K

Kepes Krisztian

Szia !

A következõ a gondom:

Adott egy wx form, ami alapot képez, egyfajta template.
Ezt szeretném felhasználni, és kiegészíteni úgy, hogy a rajta lévõ
grid-ek dinamikusan jöjjenek létre.

Sajnos ezt nem sikerült megcsinálnom, az új komponens nem látszódik
a formon, pedig show-val iratom ki.
(tehát: megjelenik a form, majd gombnyomásra elkészül(né)nek a grid-ek).

Pl. gombnyomásra akarok egy új gridet:

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()

De nem jelenik meg. Miért ?


Egy másik kérdés: hogyan lehet egy grid-et törölni, hogy utána
megint jöhessen a creategrid ??? Egyenkként kell törölni, és
hozzáadni a sorokat, oszlopokat ?


Elõre is köszi:
KK
 
B

Brian Kelley

Kepes Krisztian wrote:

From my, I've seen this problem before and am going to guess what the
question is department...

def OnClick2(self, evt):
g=wxGrid(self, -1) # new grid
g.CreateGrid(10,10)
g.SetSize((200,300)) # doesn't matter just set a size...
self.mainsizer.Add(g, 0, wxALL|wxEXPAND, 8) # I want to show
h,w = self.GetSize() # tweak the main sizer
self.SetSize((h, w+1))
self.SetSize((h, w))
 
B

Brian Kelley

Kepes Krisztian wrote:

From my, I've seen this problem before and am going to guess what the
question is department...

def OnClick2(self, evt):
g=wxGrid(self, -1) # new grid
g.CreateGrid(10,10)
g.SetSize((200,300)) # doesn't matter just set a size...
self.mainsizer.Add(g, 0, wxALL|wxEXPAND, 8) # I want to show
h,w = self.GetSize() # tweak the main sizer
self.SetSize((h, w+1))
self.SetSize((h, w))
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top