1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| # -*-coding: iso-8859-15 -*-
import wx
class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'STRUCTURE')
self.panel = wx.Panel(self, -1)
self.sizerD = wx.GridBagSizer( hgap=10, vgap=10) # espace entre les widgets 10 horizontale, 10 verticale
self.display = wx.TextCtrl(self.panel,-1, value=" ",\
style = wx.TE_MULTILINE,size = (100,60))
self.sizerD.Add(self.display,pos=(1,0),span=(1,1), flag = wx.EXPAND)
# pos(1,0) = ligne 1 colone 0
self.sampleList = []
self.listBox = wx.ListBox(self.panel, -1,\
size = (80,120),choices = self.sampleList,\
style = wx.LB_SINGLE)
self.listBox_barre1 = wx.ListBox(self.panel, -1,\
size = (80,120),choices = self.sampleList,\
style = wx.LB_SINGLE)
self.listBox_barre2 = wx.ListBox(self.panel, -1,\
size = (80,120),choices = self.sampleList,\
style = wx.LB_SINGLE)
self.sizerD.Add(self.listBox,pos=(1,1),span=(1,1),\
flag = wx.EXPAND) # pos(1,1) = ligne 1 colone 1
self.sizerD.Add(self.listBox_barre1,pos=(1,2),span=(1,1),\
flag = wx.EXPAND) # pos(1,2) = ligne 1 colone 2
self.sizerD.Add(self.listBox_barre2,pos=(2,0),span=(1,1),\
flag = wx.EXPAND) # pos(2,0) = ligne 2 colone 0
self.panel.SetSizer(self.sizerD)
#self.SetSizeHints(500,200,1000,600)
# (mini longeur,mini hauteur,maxi longeur,maxi hauteur)
self.sizerD.Fit(self)
app = wx.PySimpleApp()
TestFrame().Show()
app.MainLoop() |