Page 1 of 1
don't show this card checkbox
Posted: Tue Oct 20, 2009 4:45 am
by bidgeeman
Hello.
I was wondering how to go about making a substack, (like a splash screen), which shows on opening the main stack but has a checkbox option to "not show it again".
I tried this script on the main stack but don't know how to make the exe remember what the users checkbox selection is for the next time the standalone is run?
Code: Select all
on openStack
if the hilite of button "Don't show" of stack "Splash" is false then
go to stack "Splash"
end if
end openStack
Can someone offer advice?
Thanks
Bidge
Posted: Tue Oct 20, 2009 9:54 am
by Mark
Hi Bidge,
Store the option in a preferences file in the correct place of the operating system (e.g. application data on Windows and the preferences folder on Mac). Read this file when your standalone starts and determine whether or not to show the splash stack.
Best,
Mark
Posted: Tue Oct 20, 2009 10:00 am
by bidgeeman
Thanks for that Mark.
I was hoping to stay away from reading/writing data but thanks for the help. I might leave the splash screen option out
Cheers
Bidge
Posted: Tue Oct 20, 2009 4:02 pm
by gyroscope
Hi Bidge
Providing that you save your first stack (which presumably will be the Splash screen) as the app and all the other substacks as separate stacks when you build your app, here's another way that should work:
Have an invisible field on your main prog substack called "SShown", for instance.
In the OpenCard of your splash stack, put:
Code: Select all
on OpenCard
if fld "SShown" on card 1 of stack "SuchAndSuch" is empty then
put "1" into fld "SShown" on card 1 of stack "SuchAndSuch"
else
hide stack "Splash"
close stack "Splash"
open stack "SuchAndSuch"
end if
end preOpenStack
Obviously you'll need a mouseUp handler on the "Splash" stack to open stack "SuchAndSuch" and close stack "Splash".
And a save Stack "SuchandSuch" somewhere in your closeStack script of main app.
With respect though, I can't see the point of a splash screen only showing once. The majority of software has splash screens, and to an extent, users expect one, I think. (Even if it's not shown automatically, it'll more than likely be in the About menu item). There is some code knocking around which will make the screen close after however many seconds you want if the user hasn't clicked it to close it anyway, I'll have another look to see if I can find it, if you like. (I seem to remember it converts the time to seconds then adds so many seconds so that if the variable > this total it'll close it).
Posted: Tue Oct 20, 2009 10:20 pm
by bidgeeman
Hi gyroscope.
Thanks for the help. I was thinking along the lines that some of those splash screens do have a option checkbox that says something like "Don't show on start" but I guess you're right. Most programs DO have a splash screen that displays for a second or two come to think of it.
Many thanks for the advice.
Cheers
Bidge