Created
November 17, 2016 02:18
-
-
Save spiridonovpolytechnic/e0a26f825898785ce36e0374b721c94a to your computer and use it in GitHub Desktop.
Dictionary driven kivy Label
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LabelD(Label): | |
def __init__(self,dictionary,key_string,**kwargs): | |
super(LabelD, self).__init__(**kwargs) | |
self.dictionary = dictionary | |
self.key_string = key_string | |
Clock.schedule_interval(self.update, 1 / 30.) | |
def update(self, *args): | |
self.text = str(self.dictionary[self.key_string]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment