Page 1 of 1

Adding Special Characters to Button Labels

Posted: Tue Oct 09, 2018 2:51 pm
by kespears
I'm creating a simple calculator. On the interface, I'm creating the buttons with standard labels on each. Can someone tell me how to add special characters to the button label like toggle and division signs? I'm using LiveCode version 9.0.0. Thanks Keith

Re: Adding Special Characters to Button Labels

Posted: Tue Oct 09, 2018 4:07 pm
by bogs
The label is just a label, you can put any character you want there. Are you talking about just a regular calculator division sign ( / ), or are you talking about the written division sign ( รท )? If the latter, it would be a character code, how you set it is going to depend.

If you go with numToChar (ascii) it is going to depend on which character set your using. If you go unicode, not so much. In either case, in code you would write something like -

Code: Select all

set the label of button "YourButtonName" to numToChar(xxx)
probably in an openCard handler.

I should probably add that it would be a ton easier to just use a picture as the buttons icon :wink:

Re: Adding Special Characters to Button Labels

Posted: Tue Oct 09, 2018 5:01 pm
by kespears
bogs: Thanks for the reply. Very helpful. Keith