MG Library

Library of Michael Galloy

single page | use frames     summary     class     fields     routine details     file attributes

dist_tools/

mg_prefs__define.pro

Preferences are stored between IDL sessions in SAV files in the directory returned by APP_USER_DIR.

Examples

To store a preference: IDL> prefs = obj_new('mg_prefs', author='mgalloy', application='myapp') IDL> prefs->set, 'last_edited', 'myfile.txt' Then in a later IDL sesson this preference can be retrieved: IDL> prefs = obj_new('mg_prefs', author='mgalloy', application='myapp') IDL> print, prefs->get('last_edited') myfile.txt

Class description for mg_prefs

Properties

application init
author init

Fields

configdir ''

directory containing preference files

Routines

result = mg_prefs::_constructFilename(prefname)

Converts a preference to a full path specified filename to store the preference.

result = mg_prefs::get(prefname, default=default, found=found)
mg_prefs::set, prefname, prefvalue

Set a preference.

mg_prefs::cleanup

Free resources.

result = mg_prefs::init(author=string, application=string)

Initialize a preference object.

mg_prefs__define

Define instance variables.

Routine details

topmg_prefs::_constructFilenameprivate

result = mg_prefs::_constructFilename(prefname)

Converts a preference to a full path specified filename to store the preference.

Return value

string

Parameters

prefname in required type=string

prefname to convert to a filename

topmg_prefs::get

result = mg_prefs::get(prefname, default=default, found=found)

Parameters

prefname

Keywords

default
found

topmg_prefs::set

mg_prefs::set, prefname, prefvalue

Set a preference.

Parameters

prefname in required type=string

preference name

prefvalue in required type=any

preference value

topmg_prefs::cleanup

mg_prefs::cleanup

Free resources.

topmg_prefs::init

result = mg_prefs::init(author=string, application=string)

Initialize a preference object.

Return value

1 for success, 0 for failure

Keywords

author in required type=string

author name

application in required type=string

application name

topmg_prefs__define

mg_prefs__define

Define instance variables.

File attributes

Modification date: Fri Mar 28 13:58:30 2008
Lines: 126
Docformat: rst rst