Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1.     def makeLabel(self):
  2.         c_label = StretchingLabel()
  3.         self.bind(pos=c_label.setter('pos'), width=c_label.setter('width'), c_description=c_label.setter('text'))
  4.  
  5.         # self.c_description = 'test'  # you should change value after bind to force update
  6.         # or use dispatch() to fire update event manually:
  7.         self.property('c_description').dispatch(self)
  8.  
  9.         # doc: https://kivy.org/doc/stable/api-kivy.properties.html#kivy.properties.Property.dispatch
  10.  
  11.         self.add_widget(c_label)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement