Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python3
- # -*- coding: utf-8 -*-
- # ex.py
- from kivy.uix.gridlayout import GridLayout
- from kivy.app import App
- from kivy.properties import StringProperty
- from kivy.base import runTouchApp
- from kivy.uix.spinner import Spinner
- from kivy.uix.boxlayout import BoxLayout
- class Ex(GridLayout):
- Status=StringProperty("I am inactive")
- Status1=StringProperty("I am the inactive member of the group")
- Status2=StringProperty("I am the inactive member of the group")
- def checkActive(self,*args):
- if args[1]==True: self.Status="I am active"
- else: self.Status="I am inactive"
- def checkActive1(self,*args):
- if args[1]==True: self.Status1="I am the active member of the group"
- else: self.Status1="I am the inactive member of the group"
- def checkActive2(self,a,b):
- if b==True: self.Status2="I am active member of the group"
- else: self.Status2="I am the inactive member of the group"
- def checkActive3(self,*args):
- if args[1]==False: self.ids['pythonLang'].active=True
- def spinner(self,*args):
- spinner = Spinner(
- # default value shown
- text='Deauth',
- # available values
- values=('Yes', 'No'),
- # just for positioning in our example
- size_hint=(None, None),
- size=(100, 44),
- #pos_hint={'center_x': .5, 'center_y': .5})
- pos_hint={'right': 1, 'center_y': 0.9})
- #pos_hint={'top': 1})
- box = BoxLayout()
- def show_selected_value(spinner, text):
- print('Choice : ', text)
- if args[1]==True:
- self.spinner= spinner
- self.Status="I am active"
- spinner.bind(text=show_selected_value)
- box.add_widget(spinner)
- runTouchApp(box)
- flag_done=1
- else:
- self.spinner.parent.remove_widget(spinner)
- self.Status="I am inactive"
- class ExApp(App):
- def build(self):
- self.title="Checkboxes"
- return Ex()
- if __name__=='__main__':
- ExApp().run()
Advertisement
Add Comment
Please, Sign In to add comment