[wxPython-users] Best practice to rganize the code

Stef Mientki s.mientki at ru.nl
Mon Mar 17 14:46:01 PDT 2008


hi Peter (and others),

Peter Damoc wrote:
> Hi Tim,
>
> actually wxpita is still in its infancy, needs to grow a little bit, 
> to mature.
why that ?
Doesn't it do it's job ?
>
> I put the link here because I looked at the code and it looks 
> beautiful. If someone wants to make something similar it can use it as 
> a source of inspiration.
I looked at it, but didn't understand much of it (probably my handicap ;-),
so I made something more simple, maybe not very "Pythonic",
but much easier to understand by non-programmers ;-)
This is an example of a real working piece of code.

    GUI = """
    self.Splitter_Plots    ,SplitterVer
      self.Panel           ,PanelVer, 010
        self.Panel_Top     ,PanelHor, 11
          label1           ,wx.StaticText  ,label = "Signal1"
          label2           ,wx.StaticText  ,label = "Signal2"
        self.Panel_X       ,wx.Panel, 11
        self.Panel_Bottom  ,PanelHor
          label11          ,wx.StaticText  ,label = "Signal1b"
          label12          ,wx.StaticText  ,label = "Signal2b"
      Panel_B              ,wx.Panel
        Button_1           ,wx.Button      ,label = "Test"
        Button_2           ,wx.Button      ,label = "Test2", pos = (100,0)
    """
    exec ( Create_GUI ( GUI ) )

cheers,
Stef




More information about the wxpython-users mailing list