Is it possible to se "fancytext" on wxPython "SetLabel"?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to se "fancytext" on wxPython "SetLabel"?

jotajotacv
Hello everybody.

My name is Juan.

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.

Thanks in advance,

Juan Jose.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

circleArea.pyw (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to se "fancytext" on wxPython "SetLabel"?

Tim Roberts
On Sep 8, 2018, at 9:56 AM, [hidden email] 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.

All you should need to do is create salida_A1 and unidades_A1 as fancy.StaticFancyText instead of wx.StaticText.

Tim Roberts, [hidden email]
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to se "fancytext" on wxPython "SetLabel"?

jotajotacv


All you should need to do is create salida_A1 and unidades_A1 as fancy.StaticFancyText instead of wx.StaticText.

Tim Roberts, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="tEsDDO05EAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ti...@...
Providenza & Boekelheide, Inc.


Hi Tim.

Thanks for your answer.

When I use "salida_A1" as "fancy.StaticFancyText" i get this error:


"Traceback               
    <module>    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.


             

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to se "fancytext" on wxPython "SetLabel"?

Tim Roberts
On Sep 9, 2018, at 3:44 PM, [hidden email] 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               
    <module>    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) ".

But you have an example in that very file of how to create a StaticFancyText...
— 
Tim Roberts, [hidden email]
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to se "fancytext" on wxPython "SetLabel"?

jotajotacv
In reply to this post by jotajotacv
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.

¿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

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

circleAreaModif.pyw (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to se "fancytext" on wxPython "SetLabel"?

Tim Roberts
On Sep 10, 2018, at 5:22 PM, [hidden email] 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, [hidden email]
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to se "fancytext" on wxPython "SetLabel"?

jotajotacv
Thank you Tim for your effort.

Juan José..



El mar., 11 sept. 2018 a las 1:22, Tim Roberts (<[hidden email]>) escribió:
On Sep 10, 2018, at 5:22 PM, [hidden email] 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, [hidden email]
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.