Bonjour à tous,

je suis en train de migrer un ptit bout de code fait en java vers python.
Etant très mauvais avec tout ce qui est interface utilisateur, je lutte à faire une gui assez simple.

Voici 2 screenshots. 1 premier fait à l'époque en Java, 1 deuxième en python.
Le but, c'est d'avoir en python le même résultat que le 1er

Java:


Python:


Voici mon code python pour m'aider. Pas besoin de vous faire un dessin, si vous pouviez m'aider à utiliser correctement les attributs de StaticText, SpinCtrl, wx.ALIGN_CENTRE & co, ça serait très sympa.


Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
		panel = wx.Panel(self, -1)
		vbox = wx.BoxSizer(wx.VERTICAL)
        	hbox1 = wx.BoxSizer(wx.HORIZONTAL) # taille / nombre
        	hbox2 = wx.BoxSizer(wx.HORIZONTAL) # texte
        	hbox3 = wx.BoxSizer(wx.HORIZONTAL) # afficher / sauvegarder
 
		textSize = wx.StaticText(panel, -1, 'Taille: ')
		spinSize = wx.SpinCtrl(panel, -1, '30', min=1)
		textNb = wx.StaticText(panel, -1, 'Nombre: ')
		spinNb = wx.SpinCtrl(panel, -1, '15', min=1)
		hbox1.Add(textSize, 0, wx.ALIGN_CENTRE)
		hbox1.Add(spinSize, 0, wx.ALIGN_CENTRE)
		hbox1.Add(textNb, 0, wx.ALIGN_CENTRE)
		hbox1.Add(spinNb, 0, wx.ALIGN_CENTRE)
		vbox.Add(hbox1, 0, wx.ALIGN_CENTRE)
 
        	text = wx.TextCtrl(panel, wx.ID_ANY, style=wx.TE_MULTILINE)
 
        	hbox2.Add(text, 0, wx.ALIGN_CENTRE)
 
		vbox.Add(hbox2, 0, wx.ALIGN_CENTRE)
 
		btnShow = wx.Button(panel, -1, 'Afficher')
		btnSave = wx.Button(panel, -1, 'Sauvegarder')
		hbox3.Add(btnShow, 0, wx.ALIGN_CENTRE)
		hbox3.Add(btnSave, 0, wx.ALIGN_CENTRE)
		vbox.Add(hbox3, 0, wx.ALIGN_CENTRE)
 
		panel.SetSizer(vbox)
merci !