mirror of
https://github.com/markqvist/Sideband.git
synced 2026-12-04 13:50:02 -05:00
Restructured repository
This commit is contained in:
parent
46269dd82b
commit
0de4c12c17
274 changed files with 51617 additions and 45 deletions
47
sbapp/kivymd/tools/patterns/MVC/View/base_screen.py_tmp
Normal file
47
sbapp/kivymd/tools/patterns/MVC/View/base_screen.py_tmp
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
from kivy.properties import ObjectProperty
|
||||
|
||||
from kivymd.app import MDApp
|
||||
from kivymd.theming import ThemableBehavior
|
||||
from kivymd.uix.screen import MDScreen
|
||||
|
||||
from Utility.observer import Observer
|
||||
|
||||
|
||||
class BaseScreenView(ThemableBehavior, MDScreen, Observer):
|
||||
"""
|
||||
A base class that implements a visual representation of the model data
|
||||
:class:`~Model.%s.%s`.
|
||||
The view class must be inherited from this class.
|
||||
"""
|
||||
|
||||
controller = ObjectProperty()
|
||||
"""
|
||||
Controller object - :class:`~Controller.%s.%s`.
|
||||
|
||||
:attr:`controller` is an :class:`~kivy.properties.ObjectProperty`
|
||||
and defaults to `None`.
|
||||
"""
|
||||
|
||||
model = ObjectProperty()
|
||||
"""
|
||||
Model object - :class:`~Model.%s.%s`.
|
||||
|
||||
:attr:`model` is an :class:`~kivy.properties.ObjectProperty`
|
||||
and defaults to `None`.
|
||||
"""
|
||||
|
||||
manager_screens = ObjectProperty()
|
||||
"""
|
||||
Screen manager object - :class:`~kivy.uix.screenmanager.ScreenManager`.
|
||||
|
||||
:attr:`manager_screens` is an :class:`~kivy.properties.ObjectProperty`
|
||||
and defaults to `None`.
|
||||
"""
|
||||
|
||||
def __init__(self, **kw):
|
||||
super().__init__(**kw)
|
||||
# Often you need to get access to the application object from the view
|
||||
# class. You can do this using this attribute.
|
||||
self.app = MDApp.get_running_app()
|
||||
# Adding a view class as observer.
|
||||
self.model.add_observer(self)
|
||||
Loading…
Add table
Add a link
Reference in a new issue