User Tools

Site Tools


doc:appunti:prog:kivy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:prog:kivy [2025/11/30 10:15] – [Config and Settings] niccolodoc:appunti:prog:kivy [2025/11/30 11:04] (current) – [Config and Settings] niccolo
Line 192: Line 192:
   - App.on_start(self)   - App.on_start(self)
  
-The ''build_config()'' should explicitly execute ''config.setdefaults()'', which implicitly will execute a ''config.read()'' if the configuration file **my.ini** exists.+The ''build_config()'' should explicitly execute ''config.setdefaults()'', which implicitly will execute a ''config.read()'' if the configuration file **app_name.ini** exists. The name of the file is derived from the App instance name, e.g. if the class is named MyApp, the file will be called **my.ini**.
  
 The ''build()'' should generally execute the ''self.create_settings()'' which automatically launches ''build_settings()'', which in turn should call explicitly the ''settings.add_json_panel()'' function. The ''build()'' should generally execute the ''self.create_settings()'' which automatically launches ''build_settings()'', which in turn should call explicitly the ''settings.add_json_panel()'' function.
Line 213: Line 213:
   * App.on_config_change()   * App.on_config_change()
  
-This function should call esplicitly the ''self.config.write()'', which is not handled automatically in every circumstances (e.g. when backgrounding an Android app).+This function should call esplicitly the ''self.config.write()'', which is not handled automatically in every circumstances (e.g. if the app crashes, etc.). The config.write() is called automatically only on graceful app shutdown, only if the app detects a config change, etc. So better to stay safe and call it explicitly on config change. 
  
doc/appunti/prog/kivy.1764494108.txt.gz · Last modified: by niccolo