Simple splash screen issue

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
jmk_phd
Posts: 213
Joined: Sat Apr 15, 2017 8:29 pm

Simple splash screen issue

Post by jmk_phd » Mon Jan 15, 2018 8:18 am

I'm surely missing something ridiculously simple, but I'm freaking out because the app is supposed to go public in a few days.

I've just added a simple splash screen (substack) as a modal dialog that includes the usual credits and copyright info, to be displayed when the app first opens and when the user chooses "About" from the app menu.

That's all fine: It displays when the app first opens and when one chooses "About" from the menu (in each case dismissed by an "OK" button rather than a timed display, so the user has enough time to read and take note of the contact info).

The thing is that when one clicks on a button on the current card of the mainstack to display a different modal dialog (to set preferences), it displays again the splash screen first. (Curiously, this doesn't happen when one clicks on a different button that summons an "ask file" dialog.)

I've tried placing the command "modal stack "Splash" " in either preOpenStack or openStack messages in the mainstack script, but neither makes a difference. I don't know where else to put this so the splash screen isn't displayed after the app is opened unless called from the "About" menu.

Any advice will be greatly appreciated.

jeff k

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

Re: Simple splash screen issue

Post by dunbarx » Mon Jan 15, 2018 6:58 pm

Hi. Not at a computer right now, but dies moving the handler to an openCard handler in the card script of the first card of the “main” card help?

At least there the handler will be localized, thought it also reduces it availability. But these things are usually only accessed at the opening of an app, where it will indeed be seen.

Craig Newman

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Simple splash screen issue

Post by jacque » Mon Jan 15, 2018 9:07 pm

When the prefs modal stack opens, preOpenStack and preOpenCard messages are sent, which your mainstack catches and executes the splash display. Do what Craig suggested and move the preOpen-whatever handler to the first card of the mainstack where it won't be triggered by any other stacks.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jmk_phd
Posts: 213
Joined: Sat Apr 15, 2017 8:29 pm

Re: Simple splash screen issue

Post by jmk_phd » Mon Jan 15, 2018 10:51 pm

Craig and Jacque --

Thanks much for your sound advice, which I will implement in v. 1.01 of the app. I know that it's poor form in LC (or any language) to rely upon kludges, but in the meantime I've resorted to employing a custom prop to work around the problem:

Code: Select all

on preOpenStack
   -- show splash screen only if custom prop cBlockSplash = false
   if the cBlockSplash of stack "MainStack" is false then
      modal stack "Splash"
      set the cBlockSplash of stack "MainStack" to true
   end if
   pass preOpenStack
end preOpenStack
It's ugly, but -- being under deadline -- it seems to work as a temporary solution.

Best,

jeff k

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”