Josiah :
I find the integer assingment to the control.
The problem is tha this control sames not have GetValue or SetValue
attribute.
I try to print content of control in a dialog.
dlg = wx.MessageDialog(self, self.txtidsystem.GetValue(),
'System Description mising',
wx.OK | wx.ICON_HAND
)
dlg.ShowModal()
dlg.Destroy()
The erro is in :
dlg = wx.MessageDialog(self, self.txtidsystem.GetValue(),
self.txtidsystem.GetValue
() → this has not property GetValue.
I don’t now what this control doe not have this attributes.
Thanks in advance
–>-----Mensagem original-----
–>De: Josiah Carlson [mailto:
jcarlson@uci.edu]
–>Enviada em: quarta-feira, 19 de julho de 2006 13:05
–>Para: Alejandro Michelin Salomon ( Adinet );
→ wxPython-users@lists.wxwidgets.org
–>Assunto: Re: [wxPython-users] Problem geting the content off
–>a TextCtrl
→
→
→
–>“Alejandro Michelin Salomon ( Adinet )”
–><
alejmsg@adinet.com.uy> wrote:
–>> In side OnBtnSaveSystemButton i can’t get the value for
–>this control.
–>>
–>> Defination:
–>>
–>> self is my frame.
–>> self.txtidsystem =
–>wx.TextCtrl(id=wxID_SYSTEMS_NEWTXTIDSYSTEM,
–>> name=‘txtidsystem’, parent=self,
–>pos=wx.Point(120, 40),
–>> size=wx.Size(128, 21),
–>style=wx._controls.TE_READONLY,
–>> value=‘’)
–>> self.txtidsystem.SetFont(wx.Font(8, wx.SWISS,
–>wx.NORMAL, wx.NORMAL,
–>> False, ‘Tahoma’))
–>>
–>>
–>> def OnBtnSaveSystemButton(self, event):
–>>
–>> sDescription = self.txtdescription.GetText()
–>> nId = self.txtidsystem.GetValue() →
–>this line geave my
–>> the error: AttributeError: ‘int’ object has no attribute ‘GetValue’
–>>
–>> How to get/set the value for a TextCtrl?
→
–>You use .GetValue() and .SetValue() . You are assigning
–>some integer value to the txtidsystem attribute somewhere.
–>If you would like to discover where, add the following
–>method to your frame definition.
→
→ def setattr(self, attr, value):
→ if attr == ‘txtidsystem’ and isinstance(value, int):
→ raise Exception, "Your problem is here
→ self.dict[attr] = value
→
→ - Josiah
→
→
–>---------------------------------------------------------------------
–>To unsubscribe, e-mail:
→
wxPython-users-unsubscribe@lists.wxwidgets.org
–>For additional commands, e-mail:
→ wxPython-users-help@lists.wxwidgets.org
→
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org