Skip to content
Advertisement

How do i resize a widget in WxPython using GridSizer

Introduction and Issue

I’ve made a gridsizer to resize my frame itself.

But because of the gridsizer if I use WX_EXPAND flag (to let them have a new height 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 here

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 able to resize my widget: what I want to be resizable

Question

Can you please tell me whats the correct and optimal way to dynamically resize a widget using a wx.GridSizer?

JavaScript

Advertisement

Answer

I will not be able to test it Leonardo but thanks for the reply ! (i did not answered because of the Global Game Jam that i was participating) I’ve found another way thanks to someone on another forum, using the app ‘WxGlade’ I was able to understand how GridBagSizer work. You can’t do things like GenericDirCtrl in WxGlade but I’ve read the code given by it by putting button and blank text like I want and putting gridbagsizer, with the previsualization and the generated code I was able to understand how GridBagSizer work.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement