Hello everybody.
My name is Juan.
I don´t know many about wxPython. I have this on my code:
“texto_r1 = “Input r1 :” self.etiqueta_r1 = fancy.StaticFancyText(self, -1, texto_r1 )”.
It works fine. But I want to use “fanctytext” in my output instead of writing this:
" self.salida_A1.SetLabel ( u"A\u2081 = " + str (round(A1,
2)) ) self.unidades_A1.SetLabel ( u" m\u00B2" )".
How can I do this?. I send the file with the complete code.
Thanks in advance,
Juan Jose.
circleArea.pyw (2.5 KB)
···
All you should need to do is create salida_A1 and unidades_A1 as fancy.StaticFancyText instead of wx.StaticText.
···
On Sep 8, 2018, at 9:56 AM, jotajotacv@gmail.com wrote:
I don´t know many about wxPython. I have this on my code:
"texto_r1 = "Input r<sub>1</sub> :" self.etiqueta_r1 = fancy.StaticFancyText(self, -1, texto_r1 )".
It works fine. But I want to use "fanctytext" in my output instead of writing this:
" self.salida_A1.SetLabel ( u"A\u2081 = " + str (round(A1, 2)) ) self.unidades_A1.SetLabel ( u" m\u00B2" )".
How can I do this?. I send the file with the complete code.
—
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
All you should need to do is create salida_A1 and unidades_A1 as fancy.StaticFancyText instead of wx.StaticText.
—
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Hi Tim.
Thanks for your answer.
When I use “salida_A1” as “fancy.StaticFancyText” i get this error:
"Traceback
C:\Users\Juan\Desktop\circleArea-2.pyw 76
init C:\Users\Juan\Desktop\circleArea-2.pyw 64
init C:\Users\Juan\Desktop\circleArea-2.pyw 24
TypeError: init() takes at least 4 arguments (2 given) ".
Thanks again,
Juan.
But you have an example in that very file of how to create a StaticFancyText…
···
On Sep 9, 2018, at 3:44 PM, jotajotacv@gmail.com wrote:
All you should need to do is create salida_A1 and unidades_A1 as fancy.StaticFancyText instead of wx.StaticText.
Thanks for your answer.
When I use “salida_A1” as “fancy.StaticFancyText” i get this error:
"Traceback
C:\Users\Juan\Desktop\circleArea-2.pyw 76
init C:\Users\Juan\Desktop\circleArea-2.pyw 64
init C:\Users\Juan\Desktop\circleArea-2.pyw 24
TypeError: init() takes at least 4 arguments (2 given) ".
—
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Thanks Tim.
I modified the code this way:
"
texto_r1 = “Input r1 :”
self.etiqueta_r1 = fancy.StaticFancyText(self, -1, texto_r1 )
self.entrada_r1 = wx.TextCtrl (self)
self.salida_A1 = fancy.StaticFancyText (self)
self.unidades_A1 = wx.StaticText(self)
"
and I get the error message that I told before.
¿What could be my mistake? Perhaps is not possible use “fancytext” in "self.salida_A1.SetLabel ( “A2 = " + str (round(A1, 2)) )”.
I send the file with the change.
Thank for your time,
Juan Jose
circleAreaModif.pyw (2.5 KB)
Thanks Tim.
I modified the code this way:
"
texto_r1 = "Input r<sub>1</sub> :"
self.etiqueta_r1 = fancy.StaticFancyText(self, -1, texto_r1 )
self.entrada_r1 = wx.TextCtrl (self)
self.salida_A1 = fancy.StaticFancyText (self)
self.unidades_A1 = wx.StaticText(self)
"
and I get the error message that I told before.
Of course. The message is telling you the exact problem. The StaticFancyTxt constructor requires three promoters. You are only passing one.
¿What could be my mistake? Perhaps is not possible use "fancytext" in "self.salida_A1.SetLabel ( "A2 = " + str (round(A1, 2)) )".
Of course it is possible, but you must look up the documentation. StaticFancyText is not identical to a StaticText, so the constructor and the methods are different. You have to call them correctly.
···
On Sep 10, 2018, at 5:22 PM, jotajotacv@gmail.com wrote:
—
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Thank you Tim for your effort.
Juan José…
···
El mar., 11 sept. 2018 a las 1:22, Tim Roberts (timr@probo.com) escribió:
On Sep 10, 2018, at 5:22 PM, jotajotacv@gmail.com wrote:
Thanks Tim.
I modified the code this way:
"
texto_r1 = "Input r<sub>1</sub> :"
self.etiqueta_r1 = fancy.StaticFancyText(self, -1, texto_r1 )
self.entrada_r1 = wx.TextCtrl (self)
self.salida_A1 = fancy.StaticFancyText (self)
self.unidades_A1 = wx.StaticText(self)
"
and I get the error message that I told before.
Of course. The message is telling you the exact problem. The StaticFancyTxt constructor requires three promoters. You are only passing one.
¿What could be my mistake? Perhaps is not possible use “fancytext” in "self.salida_A1.SetLabel ( “A2 = " + str (round(A1, 2)) )”.
Of course it is possible, but you must look up the documentation. StaticFancyText is not identical to a StaticText, so the constructor and the methods are different. You have to call them correctly.
—
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.