Grouped Buttons & clickText - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Grouped Buttons & clickText - Solved
I have five buttons in a group.
What is wrong with the code below that keeps the clickText from returning the text from the button label that I clicked?
if the clickText contains "Easy" then Correct
Does it work with labels?
How can I make this work?
Thanks So Much,
DR White
What is wrong with the code below that keeps the clickText from returning the text from the button label that I clicked?
if the clickText contains "Easy" then Correct
Does it work with labels?
How can I make this work?
Thanks So Much,
DR White
Last edited by DR White on Thu Sep 19, 2013 2:57 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
Ohhh... a button has a word attached but you are clicking on the button not the word.
on mouseUp
if the label of me contains "Easy" then put "Correct"
end mousingAround
Now you could add a custom property to the button because I don't think you want to show the answer?
Simon
on mouseUp
if the label of me contains "Easy" then put "Correct"
end mousingAround
Now you could add a custom property to the button because I don't think you want to show the answer?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Grouped Buttons & clickText
Simon,
Your suggestion seemed logical, but it did not work.
Thanks,
David
Your suggestion seemed logical, but it did not work.
Thanks,
David
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
Ahh, you have to have a label assigned,
Check the property inspector for the button.
Simon
Check the property inspector for the button.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
Got some more for you.
set the name of the button to "Correct" and the Label of the button to "Answer 1" -- this isn't code
Then it wont show as Correct.
if the short name of me = "Correct" then put "Correct" -- this is code
Simon
set the name of the button to "Correct" and the Label of the button to "Answer 1" -- this isn't code
Then it wont show as Correct.
if the short name of me = "Correct" then put "Correct" -- this is code
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Grouped Buttons & clickText
Simon,
I have the label set as "easy" of the one the buttons in the group, but the label of me comes back empty
I have the label set as "easy" of the one the buttons in the group, but the label of me comes back empty
Re: Grouped Buttons & clickText
Simon,
When I use the short name, it just returns the group ID
When I use the short name, it just returns the group ID
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
Works here???
Simon
Simon
- Attachments
-
- meName.zip
- CL 6.0
- (555 Bytes) Downloaded 194 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Grouped Buttons & clickText
Simon,
When you say "label assigned" exactly how do you mean?
When you say "label assigned" exactly how do you mean?
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
See the above attached stack.
(was an edit)
Simon
(was an edit)
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Grouped Buttons & clickText
Simon,
Show me your code that returns the button label, when you click on it.
Show me your code that returns the button label, when you click on it.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
ummm...
it's in the buttons? No?
it's in the buttons? No?
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Grouped Buttons & clickText
Simon,
Please see my first post.
Please see my first post.
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Grouped Buttons & clickText
Well I guess I completely misunderstood your question.
Could you elaborate?
If the difference is just name or lable then it's an easy change.
"put the label of me"
Simon
Could you elaborate?
If the difference is just name or lable then it's an easy change.
"put the label of me"
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Grouped Buttons & clickText
The clickText only returns a value in a control that contains actual text. Like fields. The properties of a button are not pertinent, even though those properties devolve to text, like the label. They live in a different world.
What you need to do is change to something like:
on mouseUp
answer the label of me
end mouseUp
Or you can use a handler higher up in the hierarchy that puts the label of the target.
Craig
What you need to do is change to something like:
on mouseUp
answer the label of me
end mouseUp
Or you can use a handler higher up in the hierarchy that puts the label of the target.
Craig