Created
December 4, 2017 17:24
-
-
Save Adam-Vandervorst/627c5c35bdde2a3aadbd36db818e1117 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import kivy.core.window.window_sdl2 | |
| from kivy.input.motionevent import MotionEvent | |
| from kivy.uix.widget import Widget | |
| from kivy.uix.label import Label | |
| from kivy.uix.boxlayout import BoxLayout | |
| from kivy.graphics import Line, Mesh, Rectangle, Ellipse | |
| from kivy.app import App | |
| from kivy.clock import Clock | |
| class Child(Label): | |
| def on_touch_down(self, touch): | |
| if self.parent.disabled: | |
| print("dis") | |
| else: | |
| print("ndis") | |
| class Parent(Widget): | |
| def __init__(self): | |
| super(Parent, self).__init__() | |
| c0 = Child() | |
| c1 = Child() | |
| self.add_widget(c0) | |
| self.add_widget(c1) | |
| class Main(Widget): | |
| def __init__(self): | |
| super(Main, self).__init__() | |
| p = Parent() | |
| self.add_widget(p) | |
| p.disabled = True | |
| def on_touch_down(self, touch): | |
| return super(Main, self).on_touch_down(touch) | |
| class Test(App): | |
| def build(self): | |
| # self.trace = Trace() | |
| return Main() | |
| Test().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment