Explanation of using new events on_kv_post / apply_class_lang_rules in new version 1.11.0

110 views
Skip to first unread message

Walmir Paiva

unread,
Jul 26, 2019, 2:54:04 PM7/26/19
to Kivy users support
I would like more explanations about the use of these changes in the new version 1.11.0.
Sorry, but the documentation was not very friendly with me ... :)
I followed PR's #6221 / #6257 and I believe these new features can help me with my project.
My implementation for managing widget initialization is as follows:

class MyWidget(widget):
    property_1
= StringProperty('')
    property_2
= ObjectProperty(None, allownone=True)
   
   
def __init__(self, **kwargs):
       
super(MyWidget self).__init__(**kwargs)
       
self.init_widget()
   
   
@mainthread
   
def _init_widget(self):
       
if self.property_1 != '':
           
self.do_something()
       
else:
           
self.do_something_else()
       
       
self.bind(property_2 = self.do_process)
   
...
   
#example of instantiation
wid
= MyWidget()
wid
.property_1 = 'test'
wid
.property_2 = any_object
...

How do I replace this implementation of mine with new events?
If anyone can explain me or post some example would be of great help.

Thank's

Reply all
Reply to author
Forward
0 new messages