def build(self): root = Accordion() root = Accordion(min_space=60) # Providing the orentation root = Accordion(orientation='vertical') # Adding text to each Accordion for x in range(5): item = AccordionItem(title='Title % d' % x) item.add_widget( Label(text='GFG is Good Website foe CSE Students\n' * 5)) root.add_widget(item) # Reurn the root return root
def build(self): root = Accordion() for x in xrange(5): item = AccordionItem(title='Title %d' % x) item.add_widget(Label(text='Very big content\n' * 10)) root.add_widget(item) return root
def build(self): root =Accordion() for x in range(5): item = AccordionItem(title='Title %d' %x , min_space=60) item.add_widget(Label(text='Hello Youssef \n' *5)) root.add_widget(item) return root
def build(self): lista = Accordion() item = AccordionItem( title='Amor', background_normal='cores.jpg', background_selected= 'um-video-super-legal-com-imagens-do-por-do-sol-muito-lindo.jpg') item.add_widget( Label(text=''' Bom o que sinto as vezes, tenho medo de sentir, sera que eu sou a pessoa certa?, tenho muitas insertezas, dizem que quando a gente gosta não que saber e que a pessoa pra si, mas eu agora não sei se só estou gostando será, eu mudei quero ter uma familia a pessoa que eu estou gostando ela tem seu receios. Não sei se isso é o certo, acredito que esse sentimento seja amor apaixonado tenho que esperar. Um dia tive uma crise de paixão logo outro dia me recuperei meio que não sentia mais que gosta, acredito que deva esperar. ''')) item1 = AccordionItem(title='B') item2 = AccordionItem(title='C') item1.add_widget(Label(text='Pão')) item2.add_widget(Label(text='Oleo')) lista.add_widget(item2) lista.add_widget(item) lista.add_widget(item1) return lista
def __init__(self, **kwargs): super(BaseMultiChannelConfigView, self).__init__(**kwargs) self.register_event_type('on_config_updated') accordion = Accordion(orientation='vertical', size_hint=(1.0, None)) sv = ScrollContainer(size_hint=(1.0,1.0), do_scroll_x=False) sv.add_widget(accordion) self._accordion = accordion self.add_widget(sv)
def build(self): root_acc = Accordion(orientation='vertical') for player in players_list: item = AccordionItem(title=player) btn = Button(text=player, background_color=grey) item.add_widget(btn) item = self.create_layout(player) root_acc.add_widget(item) return root_acc
def show_accordion(self): root = Accordion() for x in xrange(5): item = AccordionItem(title='Title %d' % x) item.add_widget(Label(text='Very big content\n' * 10)) root.add_widget(item) col = AnchorLayout() col.add_widget(root) return col
def build(self): root = Accordion() for x in range(5): item = AccordionItem( title='Title %d' % x, min_space=50) #involve the value of x instead of d item.add_widget(Label(text='Hello World\n' * 5)) root.add_widget(item) return root
def build(self): for device in Device.objects.order_by('pin'): GPIO.setup(device.pin, GPIO.OUT) screen = Accordion() for category in Category.objects.order_by('order'): item = AccordionItem(title=category.label) screen.add_widget(item) item.add_widget(self.buildCategory(category)) return screen
def __init__(self, **kwargs): super(SessionBrowser, self).__init__(**kwargs) self.register_event_type('on_lap_selection') accordion = Accordion(orientation='vertical', size_hint=(1.0, None)) sv = ScrollContainer(size_hint=(1.0, 1.0), do_scroll_x=False) self.selected_laps = {} self.current_laps = {} sv.add_widget(accordion) self._accordion = accordion self.add_widget(sv)
def __init__(self, **kwargs): super(InterfaceManager, self).__init__(**kwargs) self.first = Login() self.second = Accordion() self.second = Accordion(orientation='vertical') options = ['My profile', 'New Object', 'Find Objects'] for key in options: item = AccordionItem(title='%s' % key) if key == 'New Object': item.add_widget(NewObject()) if key == 'Find Objects': item.add_widget(FindObjects()) self.second.add_widget(item) self.final = Label(text="Hello World") self.add_widget(self.first)
def build(self): scroller = ScrollView(size_hint=(1, None), size=(Window.width, Window.height)) root = Accordion(orientation='vertical',size_hint_y=None,height=50*27) chart = self.create_gantt() for title in chart: item = AccordionItem(title=title) item.add_widget(Image(source=title)) root.add_widget(item) scroller.add_widget(root) return scroller
def build(self): lista = Accordion() for x in range(7): item = AccordionItem(title='Item{0}'.format(x + 1)) item.add_widget( Label(text='''Além do horizonte deve ter Algum lugar bonito pra viver em paz Onde eu possa encontrar a natureza Alegria e felicidade com certeza''')) lista.add_widget(item) return lista
def build(self): num_page = 2 root = Accordion() pages = list() for page in range(num_page): item = AccordionItem(title=f'Title{page}') grid = GridLayout(cols=3, spacing=20, padding=10) # with grid.canvas: # Color(0.5,0.6,0.7,0.8) # Rectangle(size=grid.size,pos=grid.pos) item.add_widget(grid) root.add_widget(item) pages.append(grid) #!!! this must be get from serial port !!!# Buttons_text = list(map(lambda num: 'Button ' + str(num), range(1, 6))) Buttons_status0 = [ 'open', 'close', 'deactive', 'open', 'close', 'deactive' ] Buttons_status = dict() for name, status in zip(Buttons_text, Buttons_status0): Buttons_status[name] = status # predefined constants Buttons_color = { 'open': [random(), random(), random(), 0.9], 'close': [1, 0, 0, 0.9], 'deactive': [0.5, 0.5, 0.5, 0.9] } # add Buttons to page 0 Buttons = list( map( lambda name: Button(text=name, background_color=Buttons_color[ Buttons_status[name]]), Buttons_text)) # Clock.schedule_interval(Buttons[0]., 1.0 / 60.0) # Buttons[0].bind(on_press=print('hello world')) _ = list(map(lambda button: pages[0].add_widget(button), Buttons)) # add Gauges to page 1 Gauges = list( map(lambda gauge: Gauge(value=50, size_gauge=200, size_text=19), Buttons_text)) _ = list(map(lambda gauge: pages[1].add_widget(gauge), Gauges)) ### defines events _ = list( map( lambda button: button.bind(on_press=lambda button: self. ErrorWindow()), Buttons)) return root
def build(self): self.root = Accordion(min_space=30) self.overviewItem = AccordionItem(title=unichr(252) + 'bersicht') self.overview = Overview() self.overviewItem.add_widget(self.overview) #self.closeButton = Button(text = 'Beenden', size=(100, 50), size_hint=(None, None), background_color=[1,0,0,1]) #self.closeButton.bind(on_press=self.closeApp) #self.overviewItem.add_widget(self.closeButton) self.root.add_widget(self.overviewItem) self.scheduleItem = AccordionItem(title='Stundenplan') self.schedule = Schedule() self.scheduleItem.add_widget(self.schedule) self.root.add_widget(self.scheduleItem) self.appointmentsItem = AccordionItem(title='Termine') self.appointments = Appointments() self.appointmentsItem.add_widget(self.appointments) self.root.add_widget(self.appointmentsItem) self.todoListItem = AccordionItem(title='Haushalts-Abenteuer') self.todoList = TodoList() self.todoListItem.add_widget(self.todoList) self.root.add_widget(self.todoListItem) self.newsItem = AccordionItem(title='Nachrichten') self.news = Feeds() self.newsItem.add_widget(self.news) self.root.add_widget(self.newsItem) self.pictureItem = AccordionItem(title='Bilder') self.pictureFrame = PictureFrame() self.pictureItem.add_widget(self.pictureFrame) self.root.add_widget(self.pictureItem) self.scheduleItem.collapse = False self.ledClock = LedMatrix() # initial weather data self.overview.updateWeather() # continuous updates EACH_SECOND = 1 ONE_MINUTE = 60 FOUR_HOURS = 14400 Clock.schedule_interval(self.__updateLedClock, EACH_SECOND) Clock.schedule_interval(self.__updateItems, ONE_MINUTE) Clock.schedule_interval(self.__updateWeather, FOUR_HOURS) return self.root
def __init__(self, *args, **kwargs): super(Settings, self).__init__(**kwargs) self.orientation = "vertical" self.accordion = Accordion(orientation="vertical") for x in [General, Themes, About]: item = AccordionItem(title=str(x.__name__), title_template="Panel") item.box = x(orientation="vertical") item.add_widget(item.box) self.accordion.add_widget(item) for x in self.accordion.children: x.collapse = False if type(x.box).__name__ == "General" else True self.add_widget(self.accordion) self.save_buttons = SaveButtons(size_hint_y=0.1) self.add_widget(self.save_buttons)
def build(self): root = Accordion(orientation="vertical") for x in range(4): item = AccordionItem(title='Screen %d' % x) item.add_widget(Button(text='Vis TimeLapse\n', size_hint=(0.25,0.25), pos=(100, 100))) item.add_widget(Button(text='IR TimeLapse\n', size_hint=(0.25,0.25), pos=(100, 100))) item.add_widget(Button(text='Vis Live\n', size_hint=(0.25,0.25), pos=(100, 100))) item.add_widget(Button(text='IR Live\n', size_hint=(0.25,0.25), pos=(100, 100))) root.add_widget(item) return root
def __init__(self, **kwargs): super(SessionListView, self).__init__(**kwargs) self.register_event_type('on_lap_selection') self.register_event_type('on_session_updated') self.register_event_type('on_sessions_loaded') accordion = Accordion(orientation='vertical', size_hint=(1.0, None)) sv = ScrollContainer(size_hint=(1.0, 1.0), do_scroll_x=False) self.selected_laps = {} self.current_laps = {} sv.add_widget(accordion) self._accordion = accordion self.add_widget(sv) self.sessions = [] self.datastore = None self.settings = None self._save_timeout = None self._session_accordion_items = []
def build(self): root = Accordion(orientation='vertical') item = AccordionItem(title='Gate Transactions') item.add_widget(Label(text=\ """1) Login to Port of Virginia 2) Fill in these fields 3) Click "Get URL" and paste the URL into the browser 4) Copy all text (Command or Control+A) on this page 5) Click this button to create the CSV""")) page = BoxLayout(orientation='vertical') subpage = BoxLayout(orientation='vertical') input1 = BoxLayout(orientation='horizontal') input2 = BoxLayout(orientation='horizontal') input3 = BoxLayout(orientation='horizontal') input1.add_widget(Label(text='Start Date (yyyy-mm-dd):')) self.start_date = TextInput(text=datetime.now().strftime("%Y-%m-01")) input1.add_widget(self.start_date) input2.add_widget(Label(text='End Date (yyyy-mm-dd):')) self.end_date = TextInput(text=datetime.now().strftime("%Y-%m-%d")) input2.add_widget(self.end_date) input3.add_widget(Label(text='License Plate:')) self.license_plate = TextInput(text="UN11316,UN11316,UN11316") input3.add_widget(self.license_plate) buttons = GridLayout(cols=1) button = Button(text="Get URL", font_size=24) button.bind(on_press=self.get_url) buttons.add_widget(button) button = Button(text="JSON to CSV", font_size=24) button.bind(on_press=self.json_to_csv) buttons.add_widget(button) button = Button(text="List of Licenses to CSV", font_size=24) button.bind(on_press=self.get_urls_and_json_to_csv) buttons.add_widget(button) page.add_widget(subpage) subpage.add_widget(input1) subpage.add_widget(input2) subpage.add_widget(input3) page.add_widget(buttons) item.add_widget(page) root.add_widget(item) return root
def build(self): self.title = "HP4156C Parameter Analyser" ## Main screen has a title and two accordions root = BoxLayout(orientation='vertical') ## Add a title header to the window header = Label(text="HP4156C Parameter Analyser", font_size=20, size_hint_y=None, height=25) root.add_widget(header) ## The main Accordion menu menu = Accordion() ## The first accordion tab has three buttons item = AccordionItem(title='Configuration') item.add_widget(Label(text='Very big content\n' * 10)) menu.add_widget(item) ## The second accordion tab graphs data and saves to excel item = AccordionItem(title='Results') item.add_widget(Label(text='Very big content\n' * 10)) menu.add_widget(item) ## Add the accordion to the main screen root.add_widget(menu) return root
def build(self): self.title = "HP4156C Parameter Analyser" ## Main screen has a title and two accordions root = BoxLayout(orientation='vertical') ## Add a title header to the window header = Label(text="HP4156C Parameter Analyser", font_size=20, size_hint_y=None, height=25) root.add_widget(header) ## The main Accordion menu menu = Accordion() ## The first accordion tab has three buttons item = AccordionItem(title='Configuration') item.add_widget(Configuration()) menu.add_widget(item) #the above section can be repeated to add more accordion items ## Add the accordion to the main screen root.add_widget(menu) return root
def __init__(self, mainwi, data_id, **kwars): super(detallestorneo, self).__init__() self.mainwi = mainwi self.data_id = data_id self.ids.container2.clear_widgets() #eti= Label(text="Navega por el contenido") #self.ids.container2.add_widget(eti) root = Accordion(orientation="vertical", anim_duration=2.5) item1 = AccordionItem(title="Reglas") item2 = AccordionItem(title="Fixture") item3 = AccordionItem(title="Premios") conn = mysql.connector.connect(host="167.250.49.138", user="******", passwd="civ6525639", port="3306", database="laliga") cursor = conn.cursor() q = "SELECT Reglas, Premio FROM torneos WHERE ID=" cursor.execute(q + self.data_id) for x in cursor: print(x) item1.add_widget( Label(text=x[0], text_size=(300, None), valign="top")) item2.add_widget(Label(text='%s' % x[0], text_size=(300, None))) item3.add_widget( Label(text=x[1], text_size=(300, None), halign="center", valign="top")) root.add_widget(item1) root.add_widget(item2) root.add_widget(item3) self.ids.container2.add_widget(root) conn.close()
def createaccordion(self, orderstable): #accordion view orders app = App.get_running_app() self.myaccordion = Accordion(orientation='vertical', size_hint=(1.0, 1.0)) if type(orderstable) == list: #new orders save view accordion for element in orderstable: orderid = element['_id'] acc_item = MyAccordionItem(title='order') self.lv_accordion = ListView() #listview inside accordion args_converter_accordion = lambda row_index, rec: \ {'product':rec['product_name'], 'price':rec['price'], 'mychoices':rec['mychoices']} lvaccordion_adapter = ListAdapter( data=[], args_converter=args_converter_accordion, selection_mode='none', allow_empty_selection=True, cls='ManagerListItem') self.lv_accordion.adapter = lvaccordion_adapter acc_item.add_widget(self.lv_accordion) self.lv_accordion.adapter.data = element['items'] acc_item.add_widget( SqrYelButton(text='pay', pos_hint={ 'x': .2, 'y': .10 }, on_press=partial(self.pay_order, orderid))) acc_item.add_widget( SqrYelButton(text='edit', pos_hint={ 'x': .2, 'y': .10 }, on_press=partial(self.edit, orderid))) self.myaccordion.add_widget(acc_item) else: #view for update view accordion orderid = orderstable['_id'] acc_item = MyAccordionItem(title='order') self.lv_accordion = ListView() args_converter_accordion = lambda row_index, rec: \ {'product':rec['product_name'], 'price':rec['price'], 'mychoices':rec['mychoices']} lvaccordion_adapter = ListAdapter( data=[], args_converter=args_converter_accordion, selection_mode='none', allow_empty_selection=True, cls='ManagerListItem') self.lv_accordion.adapter = lvaccordion_adapter acc_item.add_widget(self.lv_accordion) self.lv_accordion.adapter.data = orderstable['items'] acc_item.add_widget( SqrYelButton(text='pay', pos_hint={ 'x': .2, 'y': .10 }, on_press=partial(self.pay_order, orderid))) acc_item.add_widget( SqrYelButton(text='edit', pos_hint={ 'x': .2, 'y': .10 }, on_press=partial(self.edit, orderid))) self.myaccordion.add_widget(acc_item) self.total_order() app.root.management_scr.items_acc.add_widget(self.myaccordion)
def build(self): """ Build the UI """ #root layout is a horizontal box layout self.root = BoxLayout(spacing=10, padding=[5,5,5,5]) #the right box has another BoxLayout. self.rightBox = BoxLayout(orientation='vertical', size_hint=(.25, 1)) #the image goes in the top part self.entropyImage = AsyncImage(source='woodFORbippy.png', size_hint=(1, .9), allow_stretch=True, keep_ratio=True) self.rightBox.add_widget(self.entropyImage) #the progress bar in the bottom self.prog = ProgressBar(max=550, size_hint=(.9,.1), pos_hint={'right':.95}) self.rightBox.add_widget(self.prog) #the encrypt button. #this isn't added to the UI until Entropy has been collected #the first version is for BIP 38 keys. The second is for Electrum Seeds self.encButton = Button(text='Encrypt', size_hint=(.9,.1), pos_hint={'right':.95}) self.encButton.bind(on_press=self.generateBIP) self.encElectrumButton = Button(text='Encrypt', size_hint=(.9,.1), pos_hint={'right':.95}) self.encElectrumButton.bind(on_press=self.encryptElectrum) #the decrypt button. #this isn't added to the UI until decryption possibilities have been noticed self.decButton = Button(text='Decrypt', size_hint=(.9,.1), pos_hint={'right':.95}) self.decButton.bind(on_press=self.decryptBIP) self.decElectrumButton = Button(text='Decrypt', size_hint=(.9,.1), pos_hint={'right':.95}) self.decElectrumButton.bind(on_press=self.decryptElectrum) #the reset button. #this isn't added to the UI until Encryption has taken place self.resetButton = Button(text='Reset', size_hint=(.9,.1), pos_hint={'right':.95}) self.resetButton.bind(on_press=self.resetUI) #within the left hand box we split into a vertical box layout self.leftBox = BoxLayout(orientation='vertical', size_hint=(.7,1)) #the top of the left hand box is a label self.MainLabel = Label(text_size=(720,150), font_size=15, shorten=True, halign='center', valign='middle', markup=True, text='[b]Welcome to bippy[/b]\n\nTo get started choose a currency and enter an encryption passphrase.\n\nIf you already have a private key you would like to encrypt or decrypt,\n\nenter it in the \'Private Key\' box below', size_hint=(1, .4)) self.leftBox.add_widget(self.MainLabel) #for displaying the links we have an accordion layout #build it here even though it is only attached after encryption has taken place self.LinksTab = Accordion(size_hint=(1, .4)) self.Links = AccordionItem(title='Links', ) self.LinksGrid = GridLayout(cols=2, padding=(10, 10, 10, 10), spacing=(10, 20)) self.LinksGrid.add_widget(Label(text='Double Sided', font_size=11, size_hint=(.3,1), text_size=(100,50), halign='center', valign='middle')) self.DoubleLink = TextInput(multiline=False, size_hint_y=None, height=30) self.LinksGrid.add_widget(self.DoubleLink) self.LinksGrid.add_widget(Label(text='Single Sided Private Key', font_size=11, size_hint=(.3,1), text_size=(100,50), halign='center', valign='middle')) self.PrivateLink = TextInput(multiline=False, size_hint_y=None, height=30) self.LinksGrid.add_widget(self.PrivateLink) self.LinksGrid.add_widget(Label(text='Single Sided Public Address', font_size=11, size_hint=(.3,1), text_size=(100,50), halign='center', valign='middle')) self.PublicLink = TextInput(multiline=False, size_hint_y=None, height=30) self.LinksGrid.add_widget(self.PublicLink) self.Links.add_widget(self.LinksGrid) self.Message = AccordionItem(title='Complete', ) self.MessageLabel = Label(halign='center', valign='middle', text='BIP0038 encryption is complete\n\nSee below for your encrypted private key and address\n\nSee the \'Links\' tab to the left for direct links to purchase Wood Wallets') self.Message.add_widget(self.MessageLabel) #add the two 'tabs' to the main accordion widget self.LinksTab.add_widget(self.Links) self.LinksTab.add_widget(self.Message) #the bottom of the left hand pane is a grid layout self.entryPane = GridLayout(cols=2, size_hint=(1, .6), padding=(10, 40, 10, 40), spacing=(10, 40)) #within this pane we have the Text Input boxes and labels #Currency self.entryPane.add_widget(Label(text='Currency', size_hint_x=None, width=100)) self.Currency = Spinner(text='Bitcoin', values=currencyLongNamesList, size_hint_x=None, size_hint_y=None, height=40, width=50) self.Currency.bind(text=self.getCur) self.selectedCurrency = 'BTC' self.selectedCurrencyLongName = 'Bitcoin' self.entryPane.add_widget(self.Currency) #Private Key self.PrivKLabel = Label(text='Private Key\n(optional)', size_hint_x=None, width=100) self.entryPane.add_widget(self.PrivKLabel) self.PrivK = TextInput(size_hint_y=None, height=30, multiline=False) self.PrivK.bind(focus=self.checkPrivK) self.entryPane.add_widget(self.PrivK) #Password self.PassLabel = Label(text='Passphrase', size_hint_x=None, width=100) self.entryPane.add_widget(self.PassLabel) self.PasswordEnter = TextInput(size_hint_y=None, height=30, multiline=False, password=True) self.PasswordEnter.bind(focus=self.checkPassword) self.entryPane.add_widget(self.PasswordEnter) #add the entry pane to the left box self.leftBox.add_widget(self.entryPane) #add the left box to the root widget self.root.add_widget(self.leftBox) #add the rightbox to the root widget self.root.add_widget(self.rightBox) return self.root
def __init__(self, url, classes): super(IspApp, self).__init__() self.url = url self.accordion = Accordion() self.pnlCalendar = CalendarPanel(classes)
def main_menu(): #Window.fullscreen=True Window.clearcolor = (1, 140.0 / 255, 15.0 / 255, 0) Menu = BoxLayout(orientation='vertical') title = Label(text='Trages', markup=True, bold=True, color=(79.0 / 255, 15.0 / 255, 204.0 / 255, 0), font_name='RAVIE.ttf', font_size='100dp', y=Window.height / 2 - 25, x=-Window.width / 2 + 100, size_hint=(1, 0.3)) Menu.add_widget(title) root = Accordion(orientation='vertical') ButtonChildren = Button(text='Press here for children education', size_hint=(1, 0.3)) ButtonChildren.bind(on_press=go_children) s1 = 'This version of software\n is a new method of \nteaching children.\n It allows one to make \nlearning process \nmore interactive and \nsimple due to gaming form.' LabelChildren = Label(text=s1, font_name='RAVIE.ttf', font_size='20dp', max_lines=4, shorten=True, color=(113.0 / 255, 17.0 / 255, 150.0 / 255, 1)) BoxLayoutChildren = BoxLayout(orientation='horizontal') BoxLayoutChildren2 = BoxLayout(orientation='vertical') BoxLayoutChildren2.add_widget(LabelChildren) BoxLayoutChildren2.add_widget(ButtonChildren) ImageChildren = Image(source='childeduc.bmp') BoxLayoutChildren.add_widget(ImageChildren) BoxLayoutChildren.add_widget(BoxLayoutChildren2) children = AccordionItem(title='Children Education') children.add_widget(BoxLayoutChildren) ### ButtonGame = Button(text='Press here for testing', size_hint=(1, .3)) ButtonGame.bind(on_press=go_game) s2 = 'This version of software\n is a new method of \ntesting children.\n It allows one to make \ntesting process \nmore interactive and \nsimple due to gaming form.' LabelGame = Label(text=s2, font_name='RAVIE.ttf', font_size='20dp', max_lines=4, shorten=True, color=(113.0 / 255, 17.0 / 255, 150.0 / 255, 1)) BoxLayoutGame = BoxLayout(orientation='horizontal') BoxLayoutGame2 = BoxLayout(orientation='vertical') BoxLayoutGame2.add_widget(LabelGame) BoxLayoutGame2.add_widget(ButtonGame) ImageGame = Image(source='forgame.bmp') BoxLayoutGame.add_widget(ImageGame) BoxLayoutGame.add_widget(BoxLayoutGame2) game = AccordionItem(title='Game!') game.add_widget(BoxLayoutGame) ### BoxLayoutInfo = BoxLayout(orientation='horizontal') ImageInfo = Image(source='command.jpg') BoxLayoutInfo.add_widget(ImageInfo) LabelInfo = Label( text= 'We are command from \nN.Novgorod,Russia.\nWe are Max and Anna.\nWe want to help \ndeaf-mute people,\nso we created\n this application.', font_size='25dp', font_name='RAVIE.ttf', color=(113.0 / 255, 17.0 / 255, 150.0 / 255, 1)) BoxLayoutInfo.add_widget(LabelInfo) info = AccordionItem(title='About us') info.add_widget(BoxLayoutInfo) ButtonExit = Button(text='Exit') ButtonExit.bind(on_press=go_exit) ButtonExit.size_hint = (1, .1) #rexit=AccordionItem(title='Exit') #rexit.add_widget(ButtonExit) root.add_widget(children) root.add_widget(game) root.add_widget(info) #root.add_widget(rexit) root.current = children Menu.add_widget(root) Menu.add_widget(ButtonExit) return Menu
def __init__(self, **kwargs): super(ViewQuestion, self).__init__(**kwargs) self.accordion = Accordion(orientation='vertical') self.get_question()
def build(self): root = BoxLayout(orientation='vertical') self.accordion = Accordion(orientation='vertical') root.add_widget(self.accordion) self.add_rule() return root
global_idx = secs / TimeTick.scale_factor_dict['second'] return global_idx def pos_of_time(self, time): return self.index2pos(self.index_of(time)) def timedelta2dist(self, td): return td.days * self.scale def center_on_timeframe(self, start, end): self.index_0 = self.index_of(start) self.index_1 = self.index_of(end) if __name__ == '__main__': acc = Accordion(orientation='vertical') simple = AccordionItem(title='simple') simple.add_widget(Timeline()) complex_ = AccordionItem(title='complex') complex_.add_widget( Timeline(backward=True, orientation='horizontal', ticks=selected_time_ticks() + [ TimeTick(valign='top', mode='12 hours'), TimeTick(valign='line_bottom', mode='2 hours') ], line_offset=dp(130))) acc.add_widget(simple) acc.add_widget(complex_) runTouchApp(acc)