mirror of https://github.com/kivy/kivy.git
typo
This commit is contained in:
parent
e267815bc8
commit
f9eaf6ef4c
|
@ -89,21 +89,20 @@ Error Handling
|
||||||
If setting a value would otherwise raise a ValueError, you have two options to
|
If setting a value would otherwise raise a ValueError, you have two options to
|
||||||
handle the error gracefully within the property. An errorvalue is a substitute
|
handle the error gracefully within the property. An errorvalue is a substitute
|
||||||
for the invalid value. An errorhandler is a callable (single argument function
|
for the invalid value. An errorhandler is a callable (single argument function
|
||||||
or lambda) which can return a valid substitute::
|
or lambda) which can return a valid substitute.
|
||||||
|
|
||||||
|
|
||||||
errorhandler parameter::
|
errorhandler parameter::
|
||||||
|
|
||||||
# simply returns 0 if the value exceeds the bounds
|
# simply returns 0 if the value exceeds the bounds
|
||||||
bnp = BoundedNumericProperty(0, min=-500, max=500, errorvalue=0)
|
bnp = BoundedNumericProperty(0, min=-500, max=500, errorvalue=0)
|
||||||
|
|
||||||
|
|
||||||
errorvalue parameter::
|
errorvalue parameter::
|
||||||
|
|
||||||
# returns a the boundary value when exceeded
|
# returns a the boundary value when exceeded
|
||||||
bnp = BoundedNumericProperty(0, min=-500, max=500,
|
bnp = BoundedNumericProperty(0, min=-500, max=500,
|
||||||
errorhandler=lambda x: 500 if x > 500 else -500)
|
errorhandler=lambda x: 500 if x > 500 else -500)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Conclusion
|
Conclusion
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue