[wxpython-users] LED-like control with degrees symbol?

Jason Antman jason at jasonantman.com
Mon May 12 16:30:39 PDT 2008


Thanks!!!

I started to look through the code and remember seeing those strings, 
but for some reason something distracted me...

Thanks Again, Tacao.

-Jason

E. A. Tacao wrote:
> Monday, May 12, 2008, 1:52:33 PM, Jason Antman wrote:
>
>   
>> I've looked into both LEDCtrl by E.A. Tacao and the LEDNumberCtrl.
>> Does anyone know of/have a smiliar looking widget that supports the
>> degrees symbol, to display temperature?
>>     
>
> There's a dictionary named _opts in LEDCtrl.py (lines 176 to 198) that
> 'translates' characters (keys) to segments (values). The values are
> strings of seven digits, either 1s or 0s, where the first digit
> relates to the a segment, the second to b, ... the seventh to g.
>
> E. g., in line 177:
>     "1" : "0110000"
> means that for the character "1" only the b and c segments will be lit,
> and in line 192:
>     "-" : "0000001"
> means that for the character "-" only the g segment will be lit, and
> so on.
>
> Knowing that, it's easy to produce the degrees symbol just by adding
> an item to that dict:
>     chr(176) : "1100011"
>
> After inserting that item, try the demo by inserting an <Alt>+0176
> char in the value box. The C and F are already supported so now it'll
> be able to show both celsius and fahrenheit. :)
>
>   
>> PS - I'm still pretty new to wxPython, and would rather, if possible,
>> not have to code the changes myself...
>>     
>
> Too late. But it was only ONE line, anyway. ;)
>
> -- tacao
>
> No bits were harmed during the making of this e-mail. 
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
>   


More information about the wxpython-users mailing list