Repository: kivy/kivy

Issue:
Incompatibility between ButtonBehaviour and Slider
I was playing around with the behaviours, tryint to combine the `ButtonBehaviour` with the `Slider` in order to use `on_release` and `on_press` (instead of `on_touch_down` and `on_touch_up`), but it crashes when I try to move the slider.

Here is an example code to replicate the problem.

```
import kivy
from kivy.app import App
from kivy.uix.behaviors import ButtonBehavior
from kivy.uix.slider import Slider

class VideoSlider(ButtonBehavior, Slider):
    pass

class TheApp(App):
    def build(self):
        return VideoSlider()

if __name__=="__main__":
    TheApp().run()
```

And the error:

```
 Traceback (most recent call last):
   File "theapp.py", line 15, in <module>
     TheApp().run()
   File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 792, in run
     runTouchApp()
   File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 481, in runTouchApp
     EventLoop.window.mainloop()
   File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_pygame.py", line 381, in mainloop
     self._mainloop()
   File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_pygame.py", line 287, in _mainloop
     EventLoop.idle()
   File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 324, in idle
     self.dispatch_input()
   File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 309, in dispatch_input
     post_dispatch_input(*pop(0))
   File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 275, in post_dispatch_input
     wid.dispatch('on_touch_up', me)
   File "_event.pyx", line 316, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:4550)
   File "/usr/lib/python2.7/dist-packages/kivy/uix/behaviors.py", line 106, in on_touch_up
     assert(self in touch.ud)
 AssertionError
```



Discussion:
ButtonBehavior is more intended to make a non-touchable widget as a touchable widget. It would obviously broke to widget that already have/use touch informations for themselves.

This should be written in the doc.

Fair enough. Are the three touch methods involved in this (_up, _down and _move)? It might be tricky to a beginner user to realize which widgets are using those methods internally.

Also, there is an incompatibly between Video and ButtonBehavior, the problem is that both have a variable called `state`? 


Resolving patch:
diff --git a/kivy/uix/behaviors.py b/kivy/uix/behaviors.py
--- a/kivy/uix/behaviors.py
+++ b/kivy/uix/behaviors.py
@@ -15,7 +15,14 @@ class IconButton(ButtonBehavior, Image):
 .. note::
 
     The behavior class must always be _before_ the widget class. If you don't
-    specify the inheritance in this order, the behavior will not work.
+    specify the inheritance in this order, the behavior will not work because
+    the behavior methods are overwritten by the class method listed first.
+
+    Similarly, if you combine a behavior class with a class which
+    requires the use of the methods also defined by the behavior class, the
+    resulting class may not function properly. E.g. combining a ButtonBehavior
+    with a Slider, both of which require the on_touch_up methods, the resulting
+    class will not work.
 
 '''
 


Test patch: