How to insert text into a label
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to insert text into a label
Hi everyone,
It's me, the embarassing newbie again. I don't seem able to figure out how to write text into a label; size, color, position, all OK, but 'value', that is, the actual text, I can't find how to.
It's me, the embarassing newbie again. I don't seem able to figure out how to write text into a label; size, color, position, all OK, but 'value', that is, the actual text, I can't find how to.
Re: How to insert text into a label
Hi CAsba,
well, you already mentioned it and most of the time that is the correct term to use in scripting:
Best
Klaus
well, you already mentioned it and most of the time that is the correct term to use in scripting:
Code: Select all
...
set the label of btn "your_btn_here" to "I'm the label, Sir!"
...
Klaus
Re: How to insert text into a label
Sorry, I don't get it. How ? To be clear, I'm not wanting to write script, or code, into the object, I just want to display a word onto the page (onto the card ?) and I thought, probably mistakenly. that I should use a label to display text. I'm obviously missing something that's probably quite basic.
Re: How to insert text into a label
Hm, I don't get it, what object do you want to set the label for?
A button? A group?
Or just a text field without borders?
Or even the titlebar of your stack/window?
A button? A group?
Or just a text field without borders?
Or even the titlebar of your stack/window?
Re: How to insert text into a label
A text field without borders.
Re: How to insert text into a label
Well, the just use a text field and remove its borders (showborder = false).
-
- Livecode Opensource Backer
- Posts: 10094
- Joined: Fri Feb 19, 2010 10:17 am
Re: How to insert text into a label
A label and a textField are different things.
Re: How to insert text into a label
What Klaus said earlier is for changing the text of a button. For a label field, you would just
because in LC, labels are also fields.
Code: Select all
...
put "some text" into field "your_label_here"
...
Re: How to insert text into a label
Hi,
In 'edit script' I entered
...
put "Sales" into field "Field1"
...
The background color of the field is showing, it has no borders as prescribed, the text color selected is different to the background color, but the word does not appear.
(Btw, I should confess to my complete ignorance inasmuch as I was previously trying to edit the field by typing into it rather than scripting it; that's because I was working with VBA before.)
In 'edit script' I entered
...
put "Sales" into field "Field1"
...
The background color of the field is showing, it has no borders as prescribed, the text color selected is different to the background color, but the word does not appear.
(Btw, I should confess to my complete ignorance inasmuch as I was previously trying to edit the field by typing into it rather than scripting it; that's because I was working with VBA before.)
Re: How to insert text into a label
Hi CAsba,
It will not work in the namely fields script!
Best
Klaus
is the field "big" (wide/high) enough to display the complete text?
And what script did you actually work on here?In 'edit script' I entered
It will not work in the namely fields script!
You can still do this in LC, click the "contents" button (second from left) in the inspector of your field and just start typing!
Best
Klaus
Re: How to insert text into a label
I entered
"...
put "Sales" into field "Field1"
..."
"...
put "Sales" into field "Field1"
..."
Re: How to insert text into a label
Many thanks, Klaus, the contents button is just what I needed ! Now it's all fine.
Re: How to insert text into a label
CAsba, and others.
I think the issue here is that a label field itself is a bit special. So though one can "put" a value into a label field, or "set" its text property, one cannot easily edit it.
CAsba, is this the issue? Because if you do not want to change the text of such a field under some sort of script control, even from the message box, then the only way to do so is through the object inspector.
Craig
I think the issue here is that a label field itself is a bit special. So though one can "put" a value into a label field, or "set" its text property, one cannot easily edit it.
CAsba, is this the issue? Because if you do not want to change the text of such a field under some sort of script control, even from the message box, then the only way to do so is through the object inspector.
Craig
Re: How to insert text into a label
Will move this thread to the Beginners section.