Page 1 of 1

wrap label button

Posted: Mon Jun 23, 2014 4:13 pm
by francof
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

Re: wrap label button

Posted: Mon Jun 23, 2014 4:28 pm
by dunbarx
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

Re: wrap label button

Posted: Mon Jun 23, 2014 5:23 pm
by francof
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

Re: wrap label button

Posted: Mon Jun 23, 2014 8:21 pm
by [-hh]
..........

Re: wrap label button

Posted: Mon Jun 23, 2014 9:50 pm
by francof
[-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