Skip to content

Instantly share code, notes, and snippets.

@spiridonovpolytechnic
Created November 17, 2016 02:25
Show Gist options
  • Save spiridonovpolytechnic/f9de18d78a91a838ceb08cec6fce93a7 to your computer and use it in GitHub Desktop.
Save spiridonovpolytechnic/f9de18d78a91a838ceb08cec6fce93a7 to your computer and use it in GitHub Desktop.
Dictionary driving kivy button with an in-place operator
class ButtonDIPO(Button):
def __init__(self,dictionary,key_string,in_place_operator,IPO_value,**kwargs):
super(ButtonDIPO, self).__init__(**kwargs)
self.dictionary = dictionary
self.key_string = key_string
self.IPO = in_place_operator
self.IPO_value = IPO_value
def on_press(self):
self.dictionary[self.key_string] = self.IPO(self.dictionary[self.key_string],self.IPO_value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment