Quick Button Label Question

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
Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Quick Button Label Question

Post by Gage » Mon Dec 09, 2013 10:33 pm

Hello!

I have a button with a long label. For the text size I want, the label is too wide for the width of the button I want.

Is there a way to wrap the text of the label onto two lines? It would fit vertically on the button, and then would also fit horizontally.

I realize I could create a group and position a field in front of the button, but I was wondering if there was a property I could set that would allow me to wrap the label onto two lines or include a carriage return to separate it between words.

Thanks very much!
Phil E.
Last edited by Gage on Tue Dec 10, 2013 12:23 am, edited 1 time in total.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Quick Button Question

Post by Mark » Mon Dec 09, 2013 10:41 pm

Hi Phil,

You can write a text on multiple lines in a field, copy the text and paste the text in the label field in the properties inspector of your button. Make sure to paste the text in the label field and not in the name field on the properties inspector.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: Quick Button Question

Post by Gage » Mon Dec 09, 2013 10:42 pm

Mark,

Beautiful! That is perfect.

Thank you so much, and have a wonderful week!

Cheers,
Phil E.

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

Re: Quick Button Question

Post by Klaus » Tue Dec 10, 2013 12:20 am

Hi Phil,

you can directly enter multiline text in the LABEL field of the inspector!
The trick is to use "newline" code: BACKSLASH & n -> \n instead of a RETURN! :D

Example:
This is line 1\nand this is line 2

Gives:
This is line 1
and this is line 2

Obviously Livecode applies a FORMAT to the content of that field before actually setting the LABEL.


Best

Klaus

Gage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 224
Joined: Tue Mar 26, 2013 8:59 pm

Re: Quick Button Question

Post by Gage » Tue Dec 10, 2013 12:22 am

Klaus,

Wow, that is also amazing information! Thank you for pitching in. Makes perfect sense!

I hope others are able to find this useful, also!

Cheers,
Phil E.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Quick Button Label Question

Post by Mark » Tue Dec 10, 2013 12:40 am

Hi Klaus,

I didn't know about it. It isn't in the dictionary. It is quite useful.

Apparently, it works if you can type the backslash without having to use Alt Gr. or Str (the Alt key to the right of the space bar). If you need to use that key in the properties inspector, the field currently being edited will be reset to its original content.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

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

Re: Quick Button Label Question

Post by Klaus » Tue Dec 10, 2013 1:11 pm

Hi Mark,
Mark wrote:I didn't know about it. It isn't in the dictionary. It is quite useful.
I knew this from my old MetaCard days and was delighted, that it still works in LC :D


Best

Klaus

Post Reply