don't show this card checkbox

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

don't show this card checkbox

Post by bidgeeman » Tue Oct 20, 2009 4:45 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Oct 20, 2009 9:54 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Tue Oct 20, 2009 10:00 am

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

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Tue Oct 20, 2009 4:02 pm

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).

bidgeeman
Posts: 495
Joined: Wed Feb 21, 2007 7:58 am

Post by bidgeeman » Tue Oct 20, 2009 10:20 pm

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

Post Reply