Page 1 of 2

Spacing between lines on buttons

Posted: Wed Apr 18, 2018 3:21 am
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

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 4:31 am
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?

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 5:40 am
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

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 1:58 pm
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

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 2:39 pm
by FourthWorld
fixedLineHeight works with buttons?

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 3:13 pm
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.

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 3:51 pm
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

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 4:25 pm
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:
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.

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 5:44 pm
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

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 7:59 pm
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.

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 9:21 pm
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

Re: Spacing between lines on buttons

Posted: Wed Apr 18, 2018 10:00 pm
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
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.

Re: Spacing between lines on buttons

Posted: Thu Apr 19, 2018 2:18 am
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

Re: Spacing between lines on buttons

Posted: Thu Apr 19, 2018 6:48 am
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.
Selection_003.png
Field center align in the property inspector...

Re: Spacing between lines on buttons

Posted: Thu Apr 19, 2018 3:38 pm
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 2386 times