Die Dokumentation bietet an example wie DragBehaviour zu verwenden, die so lange funktioniert, wie ich pos
verwenden, um den Ort, um das Widget anzuzeigen, aber nicht, wenn ich pos_hint
:ist pos_hint mit DragBehaviour in Kivy inkompatibel?
from kivy.uix.label import Label
from kivy.app import App
from kivy.uix.behaviors import DragBehavior
from kivy.lang import Builder
kv = '''
<DragLabel>:
# Define the properties for the DragLabel
drag_rectangle: self.x, self.y, self.width, self.height
drag_timeout: 10000000
drag_distance: 0
FloatLayout:
DragLabel:
##################################
##### Comment this line and works!
pos_hint: {'x': 0.5, 'y':0.5}
size_hint: 0.25, 0.2
text: 'Drag me'
'''
class DragLabel(DragBehavior, Label):
pass
class TestApp(App):
def build(self):
return Builder.load_string(kv)
TestApp().run()
Wie kann ich pos_hint
mit DragBehaviour
? Sind sie wegen der Art, wie Kivy Eigenschaften bindet, nicht kompatibel?