All card

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jwtea
Posts: 66
Joined: Fri Mar 23, 2018 2:01 am

All card

Post by jwtea » Tue Jun 12, 2018 5:24 am

Hello everybody,

I got 10 cards and in all of the card i got the same button....

Any idea what code i can type to hide the button from all cards??

I tried this code but it failed....

Code: Select all

On preopencard 
hide btn "button" of all cards
end preopencard
Thanks!

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: All card

Post by jmburnod » Tue Jun 12, 2018 9:00 am

Hi,
You may use a preopencard in stack script

Code: Select all

on preopencard 
   hide btn "button" 
end preopencard
If your btn is the same for all cards you may use a group with background behavior.
Best regards
Jean-Marc
https://alternatic.ch

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: All card

Post by Klaus » Tue Jun 12, 2018 2:23 pm

Although LC is very english-like, this does not work, you need to use a repeat loop like:

Code: Select all

...
repeat with i = 1 to the num of cds
  hide btn "this is a button with a meaningful name, not just BUTTON, pah!" of cd i
end repeat
...

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9567
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: All card

Post by dunbarx » Tue Jun 12, 2018 4:00 pm

Do you in fact have individual identical buttons on each card? If so, do what Jean-Marc suggests. You will not regret it, because imagine you wanted to move these buttons, or change their backColor. You would have to do so on each card.

Write back if you do not know how groups work.

Craig Newman

Post Reply

Return to “Talking LiveCode”