Difficulty working with SettingPath attributes

4 views
Skip to first unread message

Paul Statham

unread,
Feb 1, 2018, 10:41:23 AM2/1/18
to kivy-...@googlegroups.com
I cannot figure out (via JSON building of a panel):
-- How to set the root start location for a 'SettingPath' in the JSON file?
-- How to change how it is displayed once selected (currently goes off the screen if string is very long)?
-- How to turn off directory selection? [solved]

SOLVED ('dirselect'): Turns out you must follow JSON syntax for Boolean types:
{
   
"type": "path",
   
"title": "File",
   
"desc": "Path to file",
   
"section": "program",
   
"key": "f_path",
   
"dirselect": false
}

Then the 'create_json_panel' calls 'json.dumps' and all is well.

My settings panel is built from a JSON file, and I was working to add a 'SettingPath' instance to it like so:

{
   
"type": "path",
   
"title": "File",
   
"desc": "Path to file",
   
"section": "program",
   
"key": "f_path",
   
"dirselect": "False"
}


In the 'build_config' I've got:

config.setdefaults('program', 'f_path', '')

The popup appears upon selection, allows selections and stores them to the .ini appropriately. However, it doesn't prevent selection of directories, which according to the documentation is the function of the 'dirselect' attribute. Not sure how to set it using JSON as:

"BooleanProperty(False)"

Does not work either.


Reply all
Reply to author
Forward
0 new messages