forked from viur-framework/viur-vi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen.py
More file actions
38 lines (28 loc) · 806 Bytes
/
Copy pathscreen.py
File metadata and controls
38 lines (28 loc) · 806 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
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
from vi import html5
from .config import conf
class Screen(html5.Div):
"""
This is the screen superclass.
It represents a basic screen and its functionality.
"""
def __init__(self, *args, **kwargs):
super(Screen, self).__init__(*args, **kwargs)
self.addClass("vi-screen")
conf["theApp"].appendChild(self)
self.hide()
def lock(self):
self.addClass("is-loading")
def unlock(self):
self.removeClass("is-loading")
def invoke(self):
"""Is called to show the screen"""
print("Invoke: %s" % self.__class__.__name__)
def remove(self):
"""Remove the screen from its parent"""
if self.parent():
self.parent().removeChild(self)
def setTitle(self, title = None):
if title is None:
title = self.__class__.__name__
conf["theApp"].setTitle(title)