summaryrefslogtreecommitdiff
path: root/test/preferences.fl
diff options
context:
space:
mode:
Diffstat (limited to 'test/preferences.fl')
-rw-r--r--test/preferences.fl34
1 files changed, 28 insertions, 6 deletions
diff --git a/test/preferences.fl b/test/preferences.fl
index e7d5b1756..ef2cc5d1a 100644
--- a/test/preferences.fl
+++ b/test/preferences.fl
@@ -45,7 +45,7 @@ Function {saveAndCloseWindowCB( Fl_Widget*, void* )} {open private return_type v
Fl::delete_widget(myWindow);} {}
}
-Function {} {open return_type int
+Function {} {open selected return_type int
} {
Fl_Window myWindow {
label {My Preferences}
@@ -78,7 +78,7 @@ Function {} {open return_type int
xywh {0 0 100 20}
}
MenuItem {} {
- label {p.m.} selected
+ label {p.m.}
xywh {0 0 100 20}
}
}
@@ -206,10 +206,32 @@ int intValue;
char buffer[80];
double doubleValue;
-Fl_Preferences app( Fl_Preferences::USER, project, application );
+char path[ FL_PATH_MAX ];
+Fl_Preferences::Root root =
+ Fl_Preferences::filename(path, FL_PATH_MAX, Fl_Preferences::USER_L, project, application);
+if (root == Fl_Preferences::UNKNOWN_ROOT_TYPE) {
+ printf("Location of future Preferences file not found.\\n");
+} else {
+ printf("Preferences file will be located at:\\n%s\\n", path);
+}
+
+Fl_Preferences app( Fl_Preferences::USER_L, project, application );
- char path[ FL_PATH_MAX ];
- app.getUserdataPath( path, sizeof(path) );
+ root = app.filename(path, FL_PATH_MAX);
+ if (root == Fl_Preferences::UNKNOWN_ROOT_TYPE) {
+ printf("Location of app Preferences file not found.\\n");
+ } else if (root == Fl_Preferences::MEMORY) {
+ printf("App Preferences are memory mapped.\\n");
+ } else {
+ printf("App Preferences file is actually located at:\\n%s\\n", path);
+ }
+
+ app.getUserdataPath( path, sizeof(path) );
+ if (path[0]) {
+ printf("Preferences user data directory is located at:\\n%s\\n", path);
+ } else {
+ printf("Location of Preferences user data directory not found.\\n");
+ }
Fl_Preferences bed( app, "Bed" );
bed.get( "alarm", buffer, "8:00", 79 );
@@ -278,7 +300,7 @@ Fl_Preferences app( Fl_Preferences::USER, project, application );
Function {writePrefs()} {open return_type void
} {
- code {Fl_Preferences app( Fl_Preferences::USER, project, application );
+ code {Fl_Preferences app( Fl_Preferences::USER_L, project, application );
Fl_Preferences bed( app, "Bed" );