[wxPython-users] Best practice to rganize the code

Stef Mientki s.mientki at ru.nl
Sun Mar 16 13:48:57 PDT 2008


>>> The whole thing works in principle but the code is a mess.
> A mess ....
> ... your  "code" above is really beautiful !!!
> Coming from Delphi,
> I can't imagine that no one has already made a routine
> to convert the above code into real working Python code.
> (As soon as I really understand sizers, I think I'll do it)
>
I couldn't wait until I understand every detail, so I wrote a creation 
function,
and although not perfect, the code belows works perfect.
I think this is really the way to go,
so if more people are interested,
let's join our knowledge and effort.

cheers,
Stef

# ***********************************************************************
# ***********************************************************************
class Simple_Test_Form ( wx.MiniFrame ):
  def __init__ ( self ):
    wx.MiniFrame.__init__( self, None, style = wx.DEFAULT_FRAME_STYLE  )

    GUI = [
    [ "Splitter1",       "wx.SplitterWindow", [],
      [[ "Panel_Top",    "wx.Panel",          [] ],
       [ "Panel_Bottom", "wx.Panel",          [],
         [[ "Button_1",  "wx.Button",         [ "label = 'Test'"  ] ],
          [ "Button_2",  "wx.Button",         [ "label = 'Test2', pos = 
(100,0)" ] ]
      ]] ]
    ]]
   
    exec ( Create_GUI ( GUI ) )
# ***********************************************************************






More information about the wxpython-users mailing list