Introduction and Issue
i’ve made a gridsizer to resize my frame iself but because of the gridsizer if i use WX_EXPAND
flag (to let them have a new heigth and width when i use self.Layout()
to refresh when the app is resized) they don’t resize the % of the screen i gave them (i put blank widget to put all my widget where i want )
example
What I have tried
i’ve tried to make a wx.GridBagSizer
but i can’t understand why it always say that GenericTreeCtrl don’t exist (its a must i need this tree) so i’m asking a way to do this with wx.GridSizer
i want to work with something like that and be abble to resize my widget: what i want to be resizable
Ive asked help on stackoverflow but after 1day no one come. :c
Here a sample that they requested from me with a condensed of my code.
class mainPanel(wx.Panel):
def __init__(self, parent, pageNum, FrameSize):
self.parent = parent
self.pageNum = pageNum
wx.Panel.__init__(self, parent=parent)
Sizer = wx.GridSizer(6,6,0,0)
self.PathList = []
self.PathSelected = []
self.pastePath = ""
self.SetSizer(Sizer)
#tree
widthA,heightA = FrameSize[0],FrameSize[1]
path = "/media/" + os.getlogin()
self.folder_tree_project = wx.GenericDirCtrl(self, wx.ID_ANY,path, (0,0), wx.Size(widthA*0.3,heightA*0.75),wx.FULL_REPAINT_ON_RESIZE|wx.DIRCTRL_MULTIPLE)
Sizer.Add(self.folder_tree_project,0,wx.LEFT,0)
self.t1 = self.folder_tree_project.GetTreeCtrl()
self.folder_tree_project.ShowHidden(False)
self.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelect,id=self.t1.GetId())
self.Bind(wx.EVT_SIZE, self.OnResize)
#--------------------------------------------------------
def OnResize(self,event):
FrameSize = self.GetSize()
self.Sizer.Layout()