-1
\$\begingroup\$

As a self learner I've found the kivy binding action (mainly in python) a bit confusing. I've seen in many source code (of kivy/ kivymd) and/or examples in kivy that some of the properties are bounded to a callback in the constructor, while others are not (though used in those callback). My queries are:

  1. Do I need to bind every created (or, custom) or provided (by kivy) properties to a callback (whenever needed to keep updated) ?
  2. In any case which is the better option, bind or fbind ?
  3. Does scheduling a callback have any advantages (particularly during widget creation)?

My corresponding assumptions are:

  1. Only bind those properties that are inter-related or inter-dependent along with those used for canvas drawing. Rest will be managed or updated internally by kivy.
  2. Almost results in the same thing (except depends on the implicit or explicit naming)
  3. As per Kivy-doc widget creation is relatively slow, that's why scheduling is necessary.

The following is only for: 'Questions on Code Review Stack Exchange must contain at least 3 lines of code.'

bind = self.bind
bind(prop1=self.callback1,...)
#vs.
fbind = self.fbind
fbind("prop1", self.callback1)

I have not found any descriptive, informative article on this so far. I need your proper, informative, thorough guidance, thank you.

\$\endgroup\$
3

Browse other questions tagged or ask your own question.