-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
31 lines (23 loc) · 853 Bytes
/
app.py
File metadata and controls
31 lines (23 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from kivymd.app import MDApp
from kivy.factory import Factory
from kivy.uix.settings import InterfaceWithSpinner
Factory.register('Grid', module='uix.grid')
Factory.register('OptionsBar', module='uix.options_bar')
Factory.register('ImageButton', module='uix.image_button')
class Minesweeper(MDApp):
def build_config(self, config):
config.setdefaults(
'minesweeper',
{
'number_satisfied': False,
}
)
def build_settings(self, settings):
settings.add_json_panel(
"Minesweeper",
self.config,
filename='config.json'
)
def on_config_change(self, config, section, key, value):
# e.g: "<kivy.config.ConfigParser object at 0x7f7a9922fc50> minesweeper number_satisfied 1"
print(config, section, key, value)