2012-03-19 14:51:29 +00:00
|
|
|
'''
|
|
|
|
TabbedPanel
|
|
|
|
============
|
|
|
|
|
|
|
|
Test of the widget TabbedPanel.
|
|
|
|
'''
|
|
|
|
|
|
|
|
from kivy.app import App
|
2012-04-06 21:52:34 +00:00
|
|
|
from kivy.uix.tabbedpanel import TabbedPanel
|
2012-07-01 16:30:46 +00:00
|
|
|
from kivy.uix.floatlayout import FloatLayout
|
2012-03-19 14:51:29 +00:00
|
|
|
from kivy.lang import Builder
|
|
|
|
|
|
|
|
Builder.load_string("""
|
2012-07-01 19:33:37 +00:00
|
|
|
|
|
|
|
<Test>:
|
|
|
|
size_hint: .5, .5
|
|
|
|
pos_hint: {'center_x': .5, 'center_y': .5}
|
2012-10-29 11:19:13 +00:00
|
|
|
do_default_tab: False
|
2012-04-06 21:52:34 +00:00
|
|
|
|
2012-10-15 19:12:02 +00:00
|
|
|
TabbedPanelItem:
|
|
|
|
text: 'first tab'
|
2012-03-19 14:51:29 +00:00
|
|
|
Label:
|
2012-10-15 19:12:02 +00:00
|
|
|
text: 'First tab content area'
|
|
|
|
TabbedPanelItem:
|
|
|
|
text: 'tab2'
|
|
|
|
BoxLayout:
|
|
|
|
Label:
|
|
|
|
text: 'Second tab content area'
|
|
|
|
Button:
|
|
|
|
text: 'Button that does nothing'
|
|
|
|
TabbedPanelItem:
|
|
|
|
text: 'tab3'
|
|
|
|
RstDocument:
|
|
|
|
text: '\\n'.join(("Hello world", "-----------", "You are in the third tab."))
|
|
|
|
|
2012-03-19 14:51:29 +00:00
|
|
|
""")
|
|
|
|
|
2012-07-01 19:33:37 +00:00
|
|
|
class Test(TabbedPanel):
|
2012-04-09 05:41:35 +00:00
|
|
|
pass
|
2012-03-19 14:51:29 +00:00
|
|
|
|
2012-06-09 15:47:03 +00:00
|
|
|
class TabbedPanelApp(App):
|
2012-03-19 14:51:29 +00:00
|
|
|
def build(self):
|
|
|
|
return Test()
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-06-09 15:47:03 +00:00
|
|
|
TabbedPanelApp().run()
|