I want to add a few simple user-configurable (ie preference) options to my app, which is distributed as a standalone on both Mac and Windows. Obviously to record the user's choices, I need to either write them to a file of some kind, or (on Windows) write stuff to the registry.
This raises two questions: a) where to put it (I don't want it stored in the folder with the app). So on the Mac I need to find the standard preferences folder. I bet there's a way to do that... but I can't find it. On Windows, I need (I guess) to locate the Windows 'system' folder (often, but not always, called "Windows"), and write an "xxx.ini" file there. Is there a way to locate the Windows system folder? b) how to format it In any other environment, I'd just write a file with a simple text or binary format, and my code would look for it at startup, parse it, rewrite it when necessary, etc. Along the way I'd have some defaults that I'd use to create the file the first time. That's certainly perfectly possible and perfectly easy in Revolution; but I wonder whether smart people would do it with a stack. If I was to use a stack, it might either be a simple stack with one card, no elements, in which I could set properties - this would just be a way of avoiding doing the parsing. Or it might be a stack with an actual user interface (eg checkboxes etc) so that when users edited the preferences, they would actually be editing the preference file itself. In the latter case at least, I guess I'd have the default version of the stack built into my standalone, and then save a copy of it as a stack in a new file? Or would you create a stack from first principles, ie create stack, create buttons etc? How has anyone else tackled this requirement? c) My last option would be use a simple file in the prefs folder on MacOS, and use direct registry set/query calls to get my preferences. Is this good? Is it dangerous? Would anyone recommend it? TIA, Ben Rubinstein | Email: [EMAIL PROTECTED] Cognitive Applications Ltd | Phone: +44 (0)1273-821600 http://www.cogapp.com | Fax : +44 (0)1273-728866
