Python - Modificar wx.TexCtrl por su indice

 
Vista:

Modificar wx.TexCtrl por su indice

Publicado por Gilberto Morales Jeronimo (1 intervención) el 15/08/2018 16:54:29
Hola buen dia.
Soy nuevo en python.

Me gustaria que alguien me ayudara con una duda que tengo.
De que manera se puede modificar un control por medio de su indice y no por el nombre.

Por ejemplo:
en este codigo creo 3 TextCtrl con el mismo nombre pero con indices diferente y al modificarlos lo quiero hacer por indice.

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
import wx
 
class Indices(wx.Dialog):
	def __init__(self, parent, title):
		wx.Dialog.__init__(self, parent = parent, title = title, size = (400,200))
		self.SetBackgroundColour('white')
		self.Centre(True)
		self.Show()
 
 
		self.txtLog = wx.TextCtrl(self, 20,style = wx.TE_READONLY, value = '', pos =(10,10), size = (200,25))
		self.txtLog = wx.TextCtrl(self, 21,style = wx.TE_READONLY, value = '', pos =(10,40), size = (200,25))
		self.txtLog = wx.TextCtrl(self, 22,style = wx.TE_READONLY, value = '', pos =(10,70), size = (200,25))
 
		self.btnStart = wx.Button(self,30, u'Start', pos = (220,10), size =(50,25))
		self.btnStart.Bind(wx.EVT_BUTTON, self.proceso)
 
	def proceso(self, event):
		self.txtLog.Id(20).AppendText('Hola')
 
 
if __name__ == '__main__':
	app = wx.App()
	frame = Indices(None, u'Inidces')
	app.MainLoop()
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder