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: 223
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Spacing between lines on buttons

Post by KimD » Wed Apr 18, 2018 3:21 am

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: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Spacing between lines on buttons

Post by FourthWorld » Wed Apr 18, 2018 4:31 am

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs » Wed Apr 18, 2018 5:40 am

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: 9644
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Spacing between lines on buttons

Post by dunbarx » Wed Apr 18, 2018 1:58 pm

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: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Spacing between lines on buttons

Post by FourthWorld » Wed Apr 18, 2018 2:39 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs » Wed Apr 18, 2018 3:13 pm

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: 9644
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Spacing between lines on buttons

Post by dunbarx » Wed Apr 18, 2018 3:51 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs » Wed Apr 18, 2018 4:25 pm

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:
Selection_004.png
Lc9
Change text height - no discernible difference.
Selection_005.png
Lc9
However, switching out to an earlier version of Lc, in this case, 6.7.11 shows it correctly...
Selection_006.png
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: 9644
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Spacing between lines on buttons

Post by dunbarx » Wed Apr 18, 2018 5:44 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs » Wed Apr 18, 2018 7:59 pm

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: 9644
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Spacing between lines on buttons

Post by dunbarx » Wed Apr 18, 2018 9:21 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs » Wed Apr 18, 2018 10:00 pm

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
Selection_011.png
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: 223
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Re: Spacing between lines on buttons

Post by KimD » Thu Apr 19, 2018 2:18 am

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Spacing between lines on buttons

Post by bogs » Thu Apr 19, 2018 6:48 am

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.
Selection_003.png
Field center align in the property inspector...
Image

KimD
Posts: 223
Joined: Wed Jul 08, 2015 5:51 am
Location: Wellington, New Zealand

Re: Spacing between lines on buttons

Post by KimD » Thu Apr 19, 2018 3:38 pm

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 6311 times

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”