Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display special caracters in a text in a widget

Status
Not open for further replies.

xa1666

Programmer
Mar 2, 2006
4
BE
Hi,
I have the following problem : I would like to display a special symbol in a text widget in TK.
The symbol is "°" (the celcius degree symbol on a keyboard).

If I use it from my keyboard then on different platforms it can appears as "-" or "^"... I think that this symbol is not
a standard ASCII symbol.

That's why it fails to be well displayed on different platforms.

Does anyone knows how to display that kind of caracter?

Thanks
 
play around with format <integer> [red]%c[/red]

_________________
Bob Rashkin
 
sorry. That should be:
format [red]%c[/red] <integer>

_________________
Bob Rashkin
 
Hi thank you for responding. I think I should have put the
TCL/TK code that gives the trouble :
In this checkbutton the variable "$gdyDictionary(rotateFootFlag)" equals to "°" end is sometimes badly displayed:

checkbutton $window.rotateFoot -text
"$gdyDictionary(rotateFootFlag)" \
-variable gdyParameters(rotateFootFlag) \
-onvalue yes\
-offvalue no

Soo I don't see where I can use format there...

Thanks in advance
 
How is the value set in the first place?

_________________
Bob Rashkin
 
Hi
it is set in an array

array set gdyDictionary {
...
rotateFootFlag {°}
...
}
 
try:
Code:
array set gdyDictionary {
...
    rotateFootFlag {[format %c 176]}
...
}



_________________
Bob Rashkin
 
Hi,

no when I do that I got the text "[format %c 176]" in the widget
 
OK. Without the {curly braces}:
Code:
array set gdyDictionary {
...
    rotateFootFlag [format %c 176]
...
}

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top