Guest User

Untitled

a guest
Aug 3rd, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.10 KB | None | 0 0
  1. #! /usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. # ex.py
  5.  
  6. from kivy.uix.gridlayout import GridLayout
  7. from kivy.app import App
  8. from kivy.properties import StringProperty
  9. from kivy.base import runTouchApp
  10. from kivy.uix.spinner import Spinner
  11. from kivy.uix.boxlayout import BoxLayout
  12.  
  13. class Ex(GridLayout):
  14.     Status=StringProperty("I am inactive")
  15.     Status1=StringProperty("I am the inactive member of the group")
  16.     Status2=StringProperty("I am the inactive member of the group")
  17.     def checkActive(self,*args):
  18.         if args[1]==True: self.Status="I am active"
  19.         else: self.Status="I am inactive"
  20.     def checkActive1(self,*args):
  21.         if args[1]==True: self.Status1="I am the active member of the group"
  22.         else: self.Status1="I am the inactive member of the group"
  23.     def checkActive2(self,a,b):
  24.         if b==True: self.Status2="I am active member of the group"
  25.         else: self.Status2="I am the inactive member of the group"
  26.     def checkActive3(self,*args):
  27.         if args[1]==False: self.ids['pythonLang'].active=True
  28.  
  29.     def spinner(self,*args):
  30.         spinner = Spinner(
  31.             # default value shown
  32.             text='Deauth',
  33.             # available values
  34.             values=('Yes', 'No'),
  35.             # just for positioning in our example
  36.             size_hint=(None, None),
  37.             size=(100, 44),
  38.             #pos_hint={'center_x': .5, 'center_y': .5})
  39.             pos_hint={'right': 1, 'center_y': 0.9})
  40.             #pos_hint={'top': 1})
  41.         box = BoxLayout()
  42.         def show_selected_value(spinner, text):
  43.             print('Choice : ', text)
  44.         if args[1]==True:
  45.             self.spinner= spinner
  46.             self.Status="I am active"
  47.             spinner.bind(text=show_selected_value)
  48.             box.add_widget(spinner)
  49.             runTouchApp(box)
  50.             flag_done=1
  51.         else:
  52.             self.spinner.parent.remove_widget(spinner)
  53.             self.Status="I am inactive"
  54.  
  55.  
  56. class ExApp(App):
  57.     def build(self):
  58.         self.title="Checkboxes"
  59.         return Ex()
  60.  
  61. if __name__=='__main__':
  62.     ExApp().run()
Advertisement
Add Comment
Please, Sign In to add comment