Skip to content

Instantly share code, notes, and snippets.

@Adam-Vandervorst
Created December 4, 2017 17:24
Show Gist options
  • Select an option

  • Save Adam-Vandervorst/627c5c35bdde2a3aadbd36db818e1117 to your computer and use it in GitHub Desktop.

Select an option

Save Adam-Vandervorst/627c5c35bdde2a3aadbd36db818e1117 to your computer and use it in GitHub Desktop.
#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