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 »

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 »

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 »

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 »

Craig,

I used that exact code and it returned empty!
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Grouped Buttons & clickText

Post by dunbarx »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

Simon,

This file is for you!
Attachments
Group.zip
(798 Bytes) Downloaded 746 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 »

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 977 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Post Reply