Underline first letter

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
CAsba
Posts: 445
Joined: Fri Sep 30, 2022 12:11 pm

Underline first letter

Post by CAsba » Fri Aug 29, 2025 10:11 am

Hi all,
Is there a way to underline the first character of a button's label ? In this case, an underlined 'N' at the beginning of 'Next' would indicate to the user that a keyboard shortcut is available (Ctrl + N).

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Underline first letter

Post by Klaus » Fri Aug 29, 2025 11:16 am

Hi CAsba,

looks like we cannot have this in a button LABEL, only for the text of fields. :(
You need to "fake" something like this with an extra field or another button or whatever.
Or just use a FIELD with a script instead of a button.


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10141
Joined: Fri Feb 19, 2010 10:17 am

Re: Underline first letter

Post by richmond62 » Fri Aug 29, 2025 11:22 am

Not that I can see.

My way of dealing with this is to use images-as-buttons.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10141
Joined: Fri Feb 19, 2010 10:17 am

Re: Underline first letter

Post by richmond62 » Fri Aug 29, 2025 11:25 am

Kalus's idea is OK up to the point that when you take your pointer over the field the cursor will change to an 'insert'.

So, I'd set up a field to look like the sort of button I want and then import a snapshot of it so you have an image looking exactly the way you want. 8)

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Underline first letter

Post by Klaus » Fri Aug 29, 2025 11:42 am

richmond62 wrote:
Fri Aug 29, 2025 11:25 am
Kalus's idea is OK up to the point that when you take your pointer over the field the cursor will change to an 'insert'.
...
Oh, come on, of course I presume that the field will be set up correctly to act as a button (locktext = TRUE etc...)

P.S.
A propos: Kalus
Are you lefthanded?
I am and also do this sometimes, since my left hand is obiously faster than my right one. :-)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10141
Joined: Fri Feb 19, 2010 10:17 am

Re: Underline first letter

Post by richmond62 » Fri Aug 29, 2025 12:16 pm

No, not lefthanded, just cackhanded. 8)

Klaus
Posts: 14213
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Underline first letter

Post by Klaus » Fri Aug 29, 2025 12:26 pm

richmond62 wrote:
Fri Aug 29, 2025 12:16 pm
No, not lefthanded, just cackhanded. 8)
:D :D :D

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10141
Joined: Fri Feb 19, 2010 10:17 am

Re: Underline first letter

Post by richmond62 » Fri Aug 29, 2025 12:54 pm

One of the annoying things is that IF one uses a field as a faux button, and the text is BOLDED, on underlining the first letter of that text that letter is de-BOLDED:
-
SShot 2025-08-29 at 14.53.36.png
-
UNLESS one is careful to REITERATE the BOLDING:
-
SShot 2025-08-29 at 14.54.50.png

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10357
Joined: Wed May 06, 2009 2:28 pm

Re: Underline first letter

Post by dunbarx » Fri Aug 29, 2025 1:52 pm

Much ado about little.
UnderlineButton.livecode.zip
(1.16 KiB) Downloaded 25 times
Craig

Post Reply