Grouped Buttons & clickText - Solved

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

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 1:46 am

Craig,

I tried that exact code
"answer label of me"

and the reply was empty

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Grouped Buttons & clickText

Post by Simon » Tue Aug 27, 2013 1:51 am

Did you try that script in the stack I posted?

Simon
EDIT I get Answer 1 , Answer 2 and Answer 3
Last edited by Simon on Tue Aug 27, 2013 1:53 am, edited 1 time in total.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 1:53 am

Craig,

I used that exact code and it returned empty!

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 1:55 am

Craig,

I used that exact code and it returned empty!

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

Re: Grouped Buttons & clickText

Post by dunbarx » Tue Aug 27, 2013 1:56 am

Doc.

The label is a basic property of a button, and if it is not empty (the default) then you will get text back. Go to the property inspector and see if, in fact, there is a label or not.

If there is, and you are getting empty, we need to know about it. But I bet you not.

I do not suppose that the mouseUp message is being diverted somehow, and that the button script is not actually being executed? Put a breakpoint at the "on mouseup" line and make sure that the button handler is being run.

Craig

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Grouped Buttons & clickText

Post by Simon » Tue Aug 27, 2013 2:00 am

Maybe post your stack.
This is not a difficult task, answering the label of the button.
Really, it shouldn't be.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 2:07 am

Simon and Craig,

The label of my group is empty.

I want to get the label of one the the buttons in the group, when I click on the button.

My stack is the beginning of a large program and is a mess at this stage.

Thanks,

David

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re:answer label of me

Post by DR White » Tue Aug 27, 2013 2:30 am

Grouped Buttons & clickText - NOT Solved :(

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Grouped Buttons & clickText

Post by Simon » Tue Aug 27, 2013 2:42 am

You have not responded to my question of replacing
put the short name of me
with
put the label of me.

As I said it does work here using the stack I posted!

Anybody else want to test the posted stack with the change?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 2:49 am

Simon,

I tried the code below and it does not work for me:

on MouseDown
answer label of me
if the label of me contains "Easy" then Correct
end MouseDown

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Grouped Buttons & clickText

Post by Simon » Tue Aug 27, 2013 2:51 am

Please update the stack I posted with your updated code save it and post it here.
I will figure out what is wrong.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 3:17 am

Simon,

Here a test file that I cannot get the button label from one of the buttons in the group to return when I click on it with the mouse.
I got to get up at 5AM and I need to go to bed now.

Thanks for your effort,

David

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Grouped Buttons & clickText

Post by Simon » Tue Aug 27, 2013 3:20 am

Sorry, looks like you forgot to attach??

I'm in no rush :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Grouped Buttons & clickText

Post by DR White » Tue Aug 27, 2013 3:28 am

Simon,

This file is for you!
Attachments
Group.zip
(798 Bytes) Downloaded 688 times

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Grouped Buttons & clickText

Post by Simon » Tue Aug 27, 2013 3:50 am

Ok.
Commenting out the group "on mouseDown" fixed the problem.
the "Answer.." in mouseDown threw the message path of the buttons on mouseUp.

But your code did respond as it was told to, you had "answer the label of me in the group" and since the label of the group was empty that is what you got.

You should drop some breakpoints throughout your code to see if the handler is even getting executed.
Not sure why you have so many nested groups, but it's your code. :)

Simon
Attachments
group_v2.zip
LC 6
(851 Bytes) Downloaded 918 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply