Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 9.4

FEATURE

Your Preferences in Keys

Managing preferences as key/value pairs

Issue: 9.4 (May/June 2011)
Author: JC Cruz
Author Bio: JC is a freelance engineering writer from North Vancouver, British Columbia. He frequently contributes articles to MacTech and REALbasic Developer. He also wrote for the now defunct Python Magazine, and is now working on a database e-book. Away from the writing pile, JC spends quality time with his foster nephew, as a proper uncle should. He can be reached at anarakisware-at-gmail-dot-com.
Article Description: No description available.
Article Length (in bytes): 65,355
Starting Page Number: 49
Article Number: 9408
Resource File(s):

Download Icon 9408.zip Updated: 2011-05-02 17:49:01

Related Web Link(s):

http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/PropertyLists/PropertyLists.pdf
http://docs.realsoftware.com/index.php/Dictionary
http://en.wikipedia.org/wiki/Associative_array
http://en.wikipedia.org/wiki/INI_file
http://en.wikipedia.org/wiki/Property_list
http://en.wikipedia.org/wiki/YAML
http://www.apple.com/DTDs/PropertyList-1.0.dtd

Excerpt of article text...

Rare is the software product that ships as is. In fact, most products permit users to adjust their behaviours, to make changes that bests suit each user's work habits.

So today we take a good look at how we manage a user's settings. We will study how to render these settings as key/value pairs, and how to store them to an external file. We will examine four types of file formats and the benefits they offer. We will even study the Dictionary class, which will serve as our data model.

When Users Customize

The modern software applications uses settings to prepare and direct some of its processes. These settings are held in a central buffer and are written to an external file when the product ends its session. Some settings are made available to the current session. Others are used to prepare the next session.

Most applications provide a dedicated window to view and alter its settings. This window, called the preferences window may be modal, requiring immediate attention. Or it may be non-modal, allowing users to continue interacting with the product. Some applications dispense with the window, preferring instead for users to alter the settings file directly.

...End of Excerpt. Please purchase the magazine to read the full article.