Adding Special Characters to Button Labels

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
kespears
Posts: 27
Joined: Sat Aug 04, 2018 2:07 pm

Adding Special Characters to Button Labels

Post by kespears » Tue Oct 09, 2018 2:51 pm

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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Adding Special Characters to Button Labels

Post by bogs » Tue Oct 09, 2018 4:07 pm

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:
Image

kespears
Posts: 27
Joined: Sat Aug 04, 2018 2:07 pm

Re: Adding Special Characters to Button Labels

Post by kespears » Tue Oct 09, 2018 5:01 pm

bogs: Thanks for the reply. Very helpful. Keith

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”