NAME
FLTK::Preferences - Application preferences
Description
Preferences are data trees containing a root, branches and leaves.
Functions
deleteEntry
deleteGroup
destroy
$preferences->destroy( );
-
Destroy individual keys.
Destroying the base preferences will flush changes to the prefs file. After destroying the base, none of the depending preferences must be read or written.
entries
entry
my $key = $preferences->entry( $index );
-
Returns the name of an entry. There is no guaranteed order of entry names and
$index
must be within the range given byentries()
.
entryExists
flush
$preferences->flush( );
-
Writes all preferences to disk. This method works only with the base preference group.
Note: This method is rarely used as the preferences flush automatically when
destroy( )
is called or when the base preferences go out of scope.
get
getUserdataPath
my $path = $preferences->getUserdataPath( );
-
Creates a path that is related to the preferences file and that is usable for application data beyond what is covered by Preferences.
group
my $name = $preferences->group( $index );
-
Returns the group name of the
$index
th group. There is no guaranteed order of group names and$index
must be within the range given bygroups( )
.
groupExists
groups
my $count = $preferences->groups( );
-
Returns the number of groups that are contained within a group.
new
my $tree = $preferences->new( $root, $vendor, $application );
-
Creates a new preferences object.
$root
is a value representing either per machine (FLTK::Preferences::SYSTEM
) or per user (FLTK::Preferences::USER
) settings.vendor
is the unique identification of the author or vendor of$application
.Note: vendor must be a valid directory name.
$application
is a vendor unique application name, for example,PreferencesTest
. Multiple preferences files can be created per application.Note: application name must be a valid file name.
my $node = $preferences->new( $parent, $group );
-
Creates a Preferences node in relation to a parent node for reading and writing
$parent
is the base name for the group.$group
is a group name which may contain/
separated group names.
Example:
my $colors = FLTK::Preferences->new( $prefs, 'setup/colors' );
my $prefs = $preferences->new( $path, $vendor, $application );
-
Creates a Preferences object.
$path
is an application-supplied path.
set
size
Author
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
License and Legal
Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.