wrap label button

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
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

wrap label button

Post by francof » Mon Jun 23, 2014 4:13 pm

Hi all,
to put a long text of a label in 2 lines I found in this old post
http://forums.livecode.com/viewtopic.ph ... ton#p92159
these 2 solutions:

1° posted by Mark
....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.....
and it's works.


2° posted by Klaus
.....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.
but, with this last way, I failed to get the 2 lines of the label.

my text is: Domanda Successiva
and typing: Domanda\nSuccessiva
the label don't change (wrap?) where I was wrong?

franco

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

Re: wrap label button

Post by dunbarx » Mon Jun 23, 2014 4:28 pm

Not sure what this is all about. Mark was spot on in noting that you want to set the label of that button, and not its name, but this works fine:

Code: Select all

on mouseUp
   set the label of me to  "Domanda" & return & "Successiva"
end mouseUp
Is there something I am missing? We are not talking about a label field, are we?

Craig Newman

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: wrap label button

Post by francof » Mon Jun 23, 2014 5:23 pm

dunbarx wrote:.........
Is there something I am missing? We are not talking about a label field, are we?

Craig Newman
yes we are talking about a label button not his name.
I resolved with the 1° exemple ( of Mark), I'm just curious to understand why the second way does not work for me.

franco

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: wrap label button

Post by [-hh] » Mon Jun 23, 2014 8:21 pm

..........
Last edited by [-hh] on Wed Aug 13, 2014 2:12 pm, edited 1 time in total.
shiftLock happens

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: wrap label button

Post by francof » Mon Jun 23, 2014 9:50 pm

[-hh] wrote:The two methods you cited are kind of 'tricky workarounds', made for earlier versions of LC. For example with 6.6.2 Klaus' method still works. With LC 7 you are also able to set labels with unicode text. This change made Klaus' method invalid.

If you wish, as I do, to set labels by script (for example depending on some action that is currently running) then Craig's method is the one of choice.
Hi, nice to know.
thanks for your explanation. i'm using LC 7.0

ciao
franco

Post Reply