Hide field on preopenstack

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

Post Reply
ali yehia
Posts: 16
Joined: Tue Aug 04, 2015 9:43 am

Hide field on preopenstack

Post by ali yehia »

I made stack and card inside it. the card has many fields. I need hide some fields and show it in certain event.

I write code

preOpenStack

hide field "t98"

end preOpenStack


But still t98 appears

What do I do?
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10416
Joined: Fri Feb 19, 2010 10:17 am

Re: Hide field on preopenstack

Post by richmond62 »

Um . . .

try this in the card script:

on preOpenCard
hide fld "t98"
end preOpenCard

it works!
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10502
Joined: Wed May 06, 2009 2:28 pm

Re: Hide field on preopenstack

Post by dunbarx »

Hi.

What Richmond said, and the reason is that the preOpenStack message fires before the card loads. So it is more prudent to put your handler in a place where it is comfortable.

Craig Newman
ali yehia
Posts: 16
Joined: Tue Aug 04, 2015 9:43 am

Re: Hide field on preopenstack

Post by ali yehia »

Thanks all

It is working
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Hide field on preopenstack

Post by Klaus »

Hi Ali,

you forgot the highly important ON in your first script:

Code: Select all

preOpenStack
   hide field "t98" 
end preOpenStack
This way, the "preopenstack" message does NOT get triggered at all!

Code: Select all

ON preOpenStack
   hide field "t98" 
end preOpenStack
Best

Klaus
Post Reply