# Test explorateur
import sys
import sys
sys.path.append('/Applications/Kivy.app/Contents/Resources/kivy')
sys.path.append('/Applications/Kivy.app/Contents/Resources/lib/sitepackages')
sys.path.append('/Users/adrienbruchet/Documents/examples/demo/pictures copie')
import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.button import Button
from kivy.uix.togglebutton import ToggleButton
from kivy.uix.slider import Slider
from kivy.uix.widget import Widget
from kivy.uix.scatter import Scatter
from kivy.uix.textinput import TextInput
from kivy.uix.treeview import TreeView, TreeViewLabel
from kivy.uix.switch import Switch
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.uix.accordion import Accordion, AccordionItem
from kivy.uix.filechooser import FileChooserIconView, FileChooserListView
class Showcase(FloatLayout):
pass
class ShowcaseApp(App):
def build(self):
root = BoxLayout(orientation='horizontal', padding=20, spacing=20)
tree = TreeView(size_hint=(None, 1), width=200, hide_root=True,
indent_level=0)
def create_tree(text):
return tree.add_node(TreeViewLabel(
text=text, is_open=True, no_selection=True))
def attach_node(text, n):
tree.add_node(TreeViewLabel(text=text), n)
tree.bind(selected_node=self.on_select_node)
n = create_tree('Buttons')
attach_node('Filechooser icon', n)
attach_node('Filechooser list', n)
root.add_widget(tree)
self.content = content = BoxLayout()
root.add_widget(content)
sc = Showcase()
sc.content.add_widget(root)
return sc
def show_filechooser_icon(self):
return FileChooserIconView()
def show_filechooser_list(self):
return FileChooserListView()
if __name__ in ('__main__', '__android__'):
ShowcaseApp().run()