wxPython demo - modules and default tab size?

Hello,

In studying the wxPython demo source code I have come up with 2 questions.

  1. What is meant by modules in the Main.py file? I’ve attached this file for reference.
    Main.py (93.8 KB)
    For example, line 2045 has a function called “RunModule(self):”. I"m a little lost as to what these modules are and/or what is meant by a “module” in this context.

  2. How is the default size of the main notebook that displays the “wxPython Overview” tab and the “Demo Code” tab determined. So far my understanding is that adding the notebook to the aui manager you can use SetMinSize(), SetBestSize() as lines 1611 and 1619 do, but the main center pane on line 1610 doesn’t use any of this and appears large and of the correct size upon program launch. Where is the size for this centerpane that contains this notebook determined?

Hi,

For (2), the size of the center pane is a function of the BestSize/MinSize of the other panes plus the overall frame size, of course, nothing special is done to it. It’s a CenterPane.
If you want a similar appearance, the only thing you need to do is to set a BestSize/MinSize for the width for the tree (left pane) and a BestSize/MinSize for the height for the log window (bottom pane).

Hi @Andrea_Gavana thank you again for the help!

I actually found that I needed to add the

.CenterPane()

to my main pane and then the resizing started working with the bestsize/minsize settings. I’ve attached my current code in case it helps someone else stuck where I was.
PlottingTop2.py (6.4 KB)

@Andrea_Gavana - just out of curiosity do you know how to change the position of the scroll bar in the GenericDirCtrl() object in aui? In my above posted file I can’t figure out how to set the horizontal scroll bar back to the left most position and the vertical scroll back to the top.

I’ve been trying to use the following:
SetScrollPos(wx.VERTICAL, 0, refresh=True)
GetScrollPos(wx.HORIZONTAL)

and I can’t seem to get a correct position (I always get a value of 1 returned from the “GetScrollPos(wx.HORIZONTAL)” and set position also doesn’t seem to do anything.

Do you see anything wrong with me using these to function calls with the GenericDirCtrl()?

For #1, all the items in the treectrl on the left refer to a Python module (a .py file) with the same name, which are located in the demo folder. When an item in the tree is selected the demo application dynamically imports that module by name, looks for a runTest function within the module, and the calls it. It also looks for a variable in that module named overview and puts the string value of that variable in the first tab in the notebook on the right.