Spacing between lines on buttons

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

KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Spacing between lines on buttons

Post by KimD »

Hi to all. I'm just getting back into LC after a years break.

I'm stuck on the simplest of things. If I have a button with the label - "Hello & return & "World", how do I reduce the (very generous) amount of white spec between the two lines of the label?

I think that if it was a field then I could use textHeight, but textHeight doesn't seem to work on buttons.

Thanks in advance.

Kim
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Spacing between lines on buttons

Post by FourthWorld »

Good to see you back here, Kim.

AFAIK button leading is based on OS text specs, and we don't currently have a property to adjust it.

Any chance you could use a field for that?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs »

FourthWorld wrote: Wed Apr 18, 2018 4:31 am Any chance you could use a field for that?
Or use a button below, and a label set to transparent on top of the button, then pass, or send, the labels mouse event to the button.

Of course, this is a kludge way to do it :D
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Spacing between lines on buttons

Post by dunbarx »

No.

Set the fixedLineHeight of the button and then set the textHeight to the value of your choice.

You can get as tight as you need.

Craig Newman
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Spacing between lines on buttons

Post by FourthWorld »

fixedLineHeight works with buttons?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs »

No, but in earlier versions of Lc, Craig's textHeight line would have been the resolution. Unfortunately, I didn't notice it making any change here in 8.x, which is what I used to test this problem on the assumption that the Op was using a newer version.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Spacing between lines on buttons

Post by dunbarx »

No.

Bogs comment about earlier versions of LC notwithstanding:

:oops:

I just saw "label" in the opening post and went and got a label field. Not a, er, label button.

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

Re: Spacing between lines on buttons

Post by bogs »

dunbarx wrote: Wed Apr 18, 2018 3:51 pm Bogs comment about earlier versions of LC notwithstanding:
Perhaps I phrased that poorly, but I'll show you what I am talking about.

Here is the code running in Lc9. Mind you, this is a linux environment not officially supported, your mileage may vary:
Lc9
Lc9
Change text height - no discernible difference.
Lc9
Lc9
However, switching out to an earlier version of Lc, in this case, 6.7.11 shows it correctly...
Lc6
Lc6
Change text height - big difference.
Image

So, whether you will see it in Lc 8/9 or not may well depend on which Os you are running on, here it was bupkiss.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Spacing between lines on buttons

Post by dunbarx »

Bogs.

I think this is worth mentioning to the team. There should be no good reason not to restore a feature that we once had, and hopefully no great difficulty in doing so And we see that at least one user would like to use it.

Craig
Last edited by dunbarx on Wed Apr 18, 2018 10:18 pm, edited 1 time in total.
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs »

I agree with everything you said Craig, unfortunately every time I submit a bug report, I'm told (in not so many words :wink: ) that I use a non supported version of the Linux Os. Curious though, you use a Mac if I remember correctly, does it work on there? The term and feature appear to still be in the dictionary, so I am guessing it means the feature is still "in there" as it were.

*Edit - never mind, I keep forgetting to pop open my own osx vm, it doesn't work there either. Will submit the bug report.

*Edit 2- It was already reported, apparently, after 8.0 GM was released,Bug 19201.

*Edit 3- Added comment saying issue still active up to Lc 9.0.
Image
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Spacing between lines on buttons

Post by dunbarx »

Bogs.

Yep checks out.

And you know, I went back just a little bit, since I am relatively new in v8, being stubborn you know, in spite of Jacque's exhortations, and found that I also set the textHeight of a button in v.6. So I was not so chagrined when I assumed it was simple to do, even though I popped out a field when clearly a button was being discussed.

So, :oops: 8)

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

Re: Spacing between lines on buttons

Post by bogs »

dunbarx wrote: Wed Apr 18, 2018 9:21 pm being stubborn you know, in spite of Jacque's exhortations, and found that I also set the textHeight of a button in v.6....
I got some of that kind of mule myself my friend, I found it worked all the way back to rev 2.2.1 at least, so you have every reason to have assumed it would still work now I think :D
Rev 2.2.1 textHeight
Rev 2.2.1 textHeight
I did find that the last time it did *not* work that way was in Mc 2.5, before it went Oss.
Image
KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Re: Spacing between lines on buttons

Post by KimD »

Thanks Richard, Bogs & Craig

I was using a button instead of a field because buttons gave me zero-script vertical centering of text. A great feature! But I can see that my work-around has created a different set of problems, so I will switch back to using fields. Unfortunately, I've also got a problem with fields; but I'll post that as a different topic.

Regards

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

Re: Spacing between lines on buttons

Post by bogs »

Glad we could help you out somewhat, but...
KimD wrote: Thu Apr 19, 2018 2:18 am I was using a button instead of a field because buttons gave me zero-script vertical centering of text.
You can actually center text vertically in a field without writing a line of code.
Field center align in the property inspector...
Field center align in the property inspector...
Image
KimD
Posts: 225
Joined: Wed Jul 08, 2015 5:51 am

Re: Spacing between lines on buttons

Post by KimD »

Thanks Bogs. Please let it be true ;-) It's possibly an issue of definitions. I've spotted lots of discussion on this forum, going back to 2007, on how to vertically centre text in a field; but I was under the impression that there was not a Property Inspector solution to this. You can use the Property Inspector > Text Tab to horizontally centre the text in a field.
Centred Text.png
Centred Text.png (3.53 KiB) Viewed 15204 times
Post Reply