I am having trouble with reading the code in thread "Tutorial: GUI programming with wxPython" (http://www.daniweb.com/forums/post623598-3.html)
Where tut shows code:
import wx """Example with sizers for dynamic resizing.""" app = wx.App(redirect=False) window = wx.Frame(None, title = 'Sample GUI App', pos = (100,100), size = (400,500)) background = wx.Panel(window) loadBtn = wx.Button(background, label = 'Load') transferBtn = wx.Button(background, label = 'Transfer') inputArea = wx.TextCtrl(background) transferArea = wx.TextCtrl(background, style = wx.TE_READONLY | wx.TE_MULTILINE) horizontalBox = wx.BoxSizer() horizontalBox.Add(inputArea, proportion = 1, border = 0) horizontalBox.Add(transferBtn, proportion = 0, border = 0) horizontalBox.Add(loadBtn, proportion = 0, border = 0) verticalBox = wx.BoxSizer(wx.VERTICAL) verticalBox.Add(horizontalBox, proportion = 0, flag = wx.EXPAND, border = 0) verticalBox.Add(transferArea, proportion = 1, flag = wx.EXPAND, border = 0) background.SetSizer(verticalBox) window.Show() app.MainLoop()
Guess my dyslexia is acting up:
It doesn't look like horizontalBox is the child of verticalBox.
"It looks like 'background' is the child of 'window' .
'loadBtn = wx.Button(background' = 'loadBtn' is the child of 'background' .
'horizontalBox.Add(inputArea' = 'horizontalBox' is the child of 'inputArea'
'verticalBox.Add(horizontalBox' = and 'verticalBox' is the child of 'horizontalBox' .
And is 'background.SetSizer(verticalBox)' saying verticalBox is parent of background?
Can someone straighten me out.
How do I properly read these statements.
Maybe if I knew the syntax of each statement.