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
| #! /usr/bin/env python
#-*- coding: utf-8 -*-
import wx
import wx.lib.scrolledpanel as scrolled
class MaFrame(wx.Frame):
def __init__(self, titre):
wx.Frame.__init__(self, None, -1, title = titre)
masque = wx.Panel(self, -1, size = (800, 600))
self.centre = scrolled.ScrolledPanel(masque, -1, style = wx.SUNKEN_BORDER, pos = (10, 10), size = (750, 400))
self.liste = wx.BoxSizer(wx.VERTICAL)
self.doublons = [0, 1, 2, 3, 4, 5]
self.UpdateCont()
self.centre.SetSizer(self.liste)
self.centre.SetAutoLayout(1)
self.centre.SetupScrolling()
self.Fit()
def UpdateCont(self):
for d in self.doublons:
blocdoublon = wx.BoxSizer(wx.HORIZONTAL)
for k in range(2):
blocdossier = wx.BoxSizer(wx.VERTICAL)
blocdossier.Add(wx.StaticText(self.centre, -1, "nom dossier"), 0, wx.EXPAND|wx.ALL, 10)
blocdossier.Add(wx.StaticText(self.centre, -1, "date"), 0, wx.EXPAND|wx.ALL, 10)
blocdoublon.Add(blocdossier,0,wx.ALIGN_CENTRE)
self.liste.Add(blocdoublon,0,wx.EXPAND)
#self.centre.SetScrollbars(0, 1, 0, len(self.doublons)*50)
class MyApp(wx.App):
def OnInit(self):
frame = MaFrame("Titre")
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MyApp()
app.MainLoop() |
Partager