Created
November 22, 2012 17:34
-
-
Save mike-perdide/4132316 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
| from kivy.app import App | |
| from kivy.lang import Builder | |
| from kivy.uix.tabbedpanel import TabbedPanel | |
| Builder.load_string(""" | |
| <TabbedPanelContent> | |
| canvas: | |
| Color: | |
| rgba: root.parent.custom_color | |
| Rectangle: | |
| size: self.size | |
| pos: self.pos | |
| <TestWidget> | |
| do_default_tab: False | |
| label1: label1 | |
| custom_color: .4, .4, .7, 1 | |
| Label: | |
| id: label1 | |
| text: "hello" | |
| TabbedPanelHeader: | |
| id: header_one | |
| content: label1 | |
| """) | |
| class TestWidget(TabbedPanel): | |
| def __init__(self): | |
| TabbedPanel.__init__(self) | |
| print self.content.parent | |
| self.bind(on_touch_down=self.print_parent) | |
| def print_parent(self, obj, event): | |
| print self.content.parent | |
| class TestApp(App): | |
| def build(self): | |
| widget = TestWidget() | |
| return widget | |
| if __name__ == "__main__": | |
| TestApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment