hiding a label field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
hiding a label field
I'm not even sure how to ask this question, but I'll give it a try.
I need to have a series of "checkbox" buttons that when checked or unchecked will "turn on" or "turn off" designated label fields. I would also need a checkbox button to "check all" or "uncheck all" of the checkboxes. The label fields will be on the same card as the checkboxes.
I have tried using some of the basic command scripts to hide the field if the hilite of the checkbox is false, etc., but I can't seem to get anything to work.
I know this may be somethinf simple, but I'm still not very proficient with Rev. I appreciate the help you guys give.
Scott
I need to have a series of "checkbox" buttons that when checked or unchecked will "turn on" or "turn off" designated label fields. I would also need a checkbox button to "check all" or "uncheck all" of the checkboxes. The label fields will be on the same card as the checkboxes.
I have tried using some of the basic command scripts to hide the field if the hilite of the checkbox is false, etc., but I can't seem to get anything to work.
I know this may be somethinf simple, but I'm still not very proficient with Rev. I appreciate the help you guys give.
Scott
Hi Scott,
Probably, you are looking for something like this:
or
and
Best,
Mark
Probably, you are looking for something like this:
Code: Select all
set the visible of fld "Your Label Field" to the hilite of me
Code: Select all
set the visible of fld "Your Label Field" to the hilite of btn 1
Code: Select all
repeat with x = 1 to number of fields of grp "Labels"
set the visible of fld x of grp "Labels" to the hilite of me
end repeat
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
label field
I'm still missing something. I've tried the suggested scripts, which are very similar to the ones I had already tried, but I still get no results. I'm sure it must be something simple that I am not doing. Any thoughts on what I should check first?
Thanks,
Scott
Thanks,
Scott
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
label field
Klaus,
Thanks — I should have thought to post the scripts before. Just a reminder of what I am trying to do: I need to toggle the visibility of label fields on and off by checking (or unchecking) a checkbox on the same card. Even though I have done a project with Rev in the last year, I have never had to use checkboxes, so bear with me.
1. I placed a checkbox button on the card ("Check" just to keep the names simple for the test).
2. Then I placed a label field on the same card ("Label")
3. I opened the script window for the check box and put,
[ set the visible of fld "Label" to the hilite of me ]
and applied. I also tried,
[ set the visible of fld "Label" to the hilite of "Check" ]
to no avail.
(I also tried going the other way around and scripting the field:
[ if the hilite of button "Check" is true then set the visible of me to true else set the visible of me to false ])
I'm sure I'm just leaving something out, but I have used Rev so little, I just can't see what it is.
Thanks for the assistance.
Scott
Thanks — I should have thought to post the scripts before. Just a reminder of what I am trying to do: I need to toggle the visibility of label fields on and off by checking (or unchecking) a checkbox on the same card. Even though I have done a project with Rev in the last year, I have never had to use checkboxes, so bear with me.
1. I placed a checkbox button on the card ("Check" just to keep the names simple for the test).
2. Then I placed a label field on the same card ("Label")
3. I opened the script window for the check box and put,
[ set the visible of fld "Label" to the hilite of me ]
and applied. I also tried,
[ set the visible of fld "Label" to the hilite of "Check" ]
to no avail.
(I also tried going the other way around and scripting the field:
[ if the hilite of button "Check" is true then set the visible of me to true else set the visible of me to false ])
I'm sure I'm just leaving something out, but I have used Rev so little, I just can't see what it is.
Thanks for the assistance.
Scott
Scott,
Have you read section 5.1.3 of the user manual? Have you had a look in the user manual at all? Do you know what messages and handlers are? I have a feeling that you need to get yourself familiar with the basics before you try to write a script.
Best,
Mark
Have you read section 5.1.3 of the user manual? Have you had a look in the user manual at all? Do you know what messages and handlers are? I have a feeling that you need to get yourself familiar with the basics before you try to write a script.
Best,
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Scott,
what Mark probably wanted but did not dare to ask
is:
Did you put a
-> on mouseup
BEFORE and
-> end mouseup
AFTER your code?
The script of the "checkbox" button should read:
Best
Klaus
what Mark probably wanted but did not dare to ask

Did you put a
-> on mouseup
BEFORE and
-> end mouseup
AFTER your code?
The script of the "checkbox" button should read:
Code: Select all
on mouseup
set the visible of fld "Label" to the hilite of me
end mouseup
Klaus
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
label field
I'm sorry I haven't been more clear. I'm not very good at this forum thing.
Yes. I am aware of handlers, etc. In fact, the only other project I have done used literally thousands (it was a 400+ card stack with 12+ buttons per card). I have just never used a checkbox or radio button before. There must be something about the mechanics of a checkbox I don't know.
I can already accomplish what I need by using two simple buttons, one for "on" and one for "off," but since I will have as many as 20-30 "on-off" sets per card, I thought it would be easier to simply use a checkbox for "on-off."
Perhaps my question should have been (instead of what script), what handlers are appropriate for using the checkbox?
Yes. I am aware of handlers, etc. In fact, the only other project I have done used literally thousands (it was a 400+ card stack with 12+ buttons per card). I have just never used a checkbox or radio button before. There must be something about the mechanics of a checkbox I don't know.
I can already accomplish what I need by using two simple buttons, one for "on" and one for "off," but since I will have as many as 20-30 "on-off" sets per card, I thought it would be easier to simply use a checkbox for "on-off."
Perhaps my question should have been (instead of what script), what handlers are appropriate for using the checkbox?
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
label field
Mark, Klaus, et al
Boy! Now I feel really stupid! My first scripts/handlers worked just fine. I just realized that my little test stack had "Show Invisible Objects" turned on. That is why I could never get the field to "go off" when I unchecked the checkbox. Dumb! Dumb! Dumb! Like I said before, I was sure it was something simple I was overlooking.
Sorry to have wasted your time; I really appreciate the patience!
Scott
Boy! Now I feel really stupid! My first scripts/handlers worked just fine. I just realized that my little test stack had "Show Invisible Objects" turned on. That is why I could never get the field to "go off" when I unchecked the checkbox. Dumb! Dumb! Dumb! Like I said before, I was sure it was something simple I was overlooking.
Sorry to have wasted your time; I really appreciate the patience!
Scott
Hi Scott,
It happens. Another nice one is to turn off messages (in the Development menu) and wonder why your script doesn't run, when you're back with a fresh mug of coffee.
Mark
It happens. Another nice one is to turn off messages (in the Development menu) and wonder why your script doesn't run, when you're back with a fresh mug of coffee.
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
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode