当前位置: 首页>>代码示例>>Python>>正文


Python DropDown.add_widget方法代码示例

本文整理汇总了Python中kivy.uix.dropdown.DropDown.add_widget方法的典型用法代码示例。如果您正苦于以下问题:Python DropDown.add_widget方法的具体用法?Python DropDown.add_widget怎么用?Python DropDown.add_widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.uix.dropdown.DropDown的用法示例。


在下文中一共展示了DropDown.add_widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: DropDownCreation

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
def DropDownCreation(data):
    Dropdown = DropDown()
    for i in data:
        drop_option = Button(text = i, size_hint_y = None, height = 40)
        drop_option.bind(on_release = lambda drop_option: Dropdown.select(drop_option.text))
        Dropdown.add_widget(drop_option)
    return Dropdown
开发者ID:piercecunneen,项目名称:HockeyStatisticsApp,代码行数:9,代码来源:Main.py

示例2: SettingsScreen

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
class SettingsScreen(ActionBarScreen):
    STR_SETTINGS = StringProperty()
    STR_RESET_DEFAULTS = StringProperty()
    STR_RESET_DEFAULTS_HELP = StringProperty()
    STR_RESET = StringProperty()
    STR_LANGUAGE_CHANGE = StringProperty()
    def __init__(self, **kwargs):   # inicializace
        self.root = kwargs['root']
        self.root.insertStrings.append((self, ))
        super(SettingsScreen, self).__init__(**kwargs)
        self.dropdown = DropDown()
        for index in LANGUAGES.itervalues():
            btn = Button(text=index, size_hint_y=None, height=44, font_size='24dp', font_name="font/Roboto-Regular.ttf")
            btn.bind(on_release=lambda btn: self.dropdown.select(btn.text))
            self.dropdown.add_widget(btn)
        self.language.bind(on_release=self.dropdown.open)
        self.dropdown.bind(on_select=lambda instance, x: setattr(self.language, 'text', x))
        self.language.bind(text=self.change)
    
    def reset_defaults(self, *args):
        # Výmaz konfiguračního souboru po stisku tlačítka reset
        self.root.Cfg = ['' for y in range(4)]
        self.root.refreshCfg()
    
    def on_pre_enter(self, *args):
        # Před vstupem na obrazovku načte jazyky
        self.language.text = LANGUAGES.get(self.root.Cfg[0])
    
    def change(self, *args):
        # Změní jazyk, znovu načte řetězce
        self.root.Cfg[0] = [y[0] for y in LANGUAGES.items() if y[1] == self.language.text][0]
        self.root.refreshCfg()
        self.root.doStrInsert()
开发者ID:Smug28,项目名称:Mobile-TetriNET,代码行数:35,代码来源:screens.py

示例3: update_action_button

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
    def update_action_button(self):
        action_button = self.ids.action_button
        options = (
            ActionButtonOption(text=_('Sign'), func=lambda btn: self.do_sign(), enabled=self.can_sign),
            ActionButtonOption(text=_('Broadcast'), func=lambda btn: self.do_broadcast(), enabled=self.can_broadcast),
            ActionButtonOption(text=_('Bump fee'), func=lambda btn: self.do_rbf(), enabled=self.can_rbf),
            ActionButtonOption(text=_('Remove'), func=lambda btn: self.remove_local_tx(), enabled=self.is_local_tx),
        )
        num_options = sum(map(lambda o: bool(o.enabled), options))
        # if no options available, hide button
        if num_options == 0:
            action_button.disabled = True
            action_button.opacity = 0
            return
        action_button.disabled = False
        action_button.opacity = 1

        if num_options == 1:
            # only one option, button will correspond to that
            for option in options:
                if option.enabled:
                    action_button.text = option.text
                    self._action_button_fn = option.func
        else:
            # multiple options. button opens dropdown which has one sub-button for each
            dropdown = DropDown()
            action_button.text = _('Options')
            self._action_button_fn = dropdown.open
            for option in options:
                if option.enabled:
                    btn = Button(text=option.text, size_hint_y=None, height=48)
                    btn.bind(on_release=option.func)
                    dropdown.add_widget(btn)
开发者ID:vialectrum,项目名称:vialectrum,代码行数:35,代码来源:tx_dialog.py

示例4: __init__

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
  def __init__(self, widget, **kwargs):
    super(DataBindingEditor, self).__init__(**kwargs)
    dropdown = DropDown()
    
    for variable in variables:
      # when adding widgets, we need to specify the height manually (disabling
      # the size_hint_y) so the dropdown can calculate the area it needs.
      btn = Button(text='%s' % variable, size_hint_y=None, height=40)

      # for each button, attach a callback that will call the select() method
      # on the dropdown. We'll pass the text of the button as the data of the
      # selection.
      btn.bind(on_release=lambda btn: dropdown.select(btn.text))

      # then add the button inside the dropdown
      dropdown.add_widget(btn)

    # create a big main button
    mainbutton = Button(text=widget.variable.name, size_hint=(None, None), pos_hint={'center_x': 0.5, 'center_y': 0.5})

    # show the dropdown menu when the main button is released
    # note: all the bind() calls pass the instance of the caller (here, the
    # mainbutton instance) as the first argument of the callback (here,
    # dropdown.open.).
    mainbutton.bind(on_release=dropdown.open)

    # one last thing, listen for the selection in the dropdown list and
    # assign the data to the button text.
    dropdown.bind(on_select=lambda instance, x: setattr(mainbutton, 'text', x))
    dropdown.bind(on_select=lambda instance, x: widget.set_var(x))
    

    self.add_widget(mainbutton)
开发者ID:victor-rene,项目名称:MicroScada,代码行数:35,代码来源:databindingeditor.py

示例5: ouvrirMenuAttaque

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
	def ouvrirMenuAttaque(self):
		box = BoxLayout(orientation='vertical')
		self.fenetreAttaque = Popup(title="Attaque")
		dropdown = DropDown()
		stats = Label(text='Veuillez selectionner une cible')
		confirm = Button(text="Voir")
		attaquer = Button(text="Attaquer")
		
		for key in store:
			btn = Button(text=store.get(key)['nom'], size_hint_y=None, height=44)
			btn.bind(on_release=lambda btn: dropdown.select(btn.text))  
			dropdown.add_widget(btn)
		mainbutton = Button(text='Cible :', size_hint=(None, None))
		mainbutton.bind(on_release=dropdown.open)
		dropdown.bind(on_select=lambda instance, x: setattr(mainbutton, 'text', x))
		box2 = BoxLayout(orientation='horizontal')
		
		fermer = Button(text="Fermer", font_size=20)
		box.add_widget(mainbutton)
		box.add_widget(stats)
		box2.add_widget(confirm)
		box2.add_widget(attaquer)
		box.add_widget(box2)
		box.add_widget(fermer)
		self.fenetreAttaque.add_widget(box)
		mainbutton.size_hint=(1,.1)
		confirm.size_hint=(.1,.1)
		fermer.size_hint=(1,.1)
		attaquer.size_hint=(.1,.1)
		confirm.bind(on_press=lambda x: self.actualise(stats, mainbutton.text))
		attaquer.bind(on_press=lambda x: self.attaque(mainbutton.text))
		fermer.bind(on_press=self.fenetreAttaque.dismiss)
		self.fenetreAttaque.open()
开发者ID:SuperToad,项目名称:SmartphoneGame,代码行数:35,代码来源:inCastle.py

示例6: acilirKutu

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
class acilirKutu(App):

    def secim(self, nesne):
        # Önceden seçilmiş bir düğme var ise, arka plan rengini
        # ön tanımlı renge dönüştürelim
        if self.acilirkutu.secim:
            self.acilirkutu.secim.background_color= [1, 1, 1, 1]
            
        self.acilirkutu.select(nesne.text)
        self.anadugme.text=nesne.text
        
        # secim özelliğine yeni nesneyi ekleyelim ve
        # arka plan rengini kırmızı yapalım
        self.acilirkutu.secim=nesne
        nesne.background_color= 1, 0, 0, 1

    def build(self):
        duzen = BoxLayout()
        self.anadugme = Button(text='Başlat', size_hint=(None, None))

        self.acilirkutu = DropDown()
        self.acilirkutu.secim=None
        
        for x in ( "Mustafa", "Dilek", "Fatih", "Melike"):
            dugme=Button(text=x, size_hint_y=None, height=25)
            dugme.bind(on_release=self.secim)
            self.acilirkutu.add_widget(dugme)

        self.anadugme.bind(on_release=self.acilirkutu.open)
        duzen.add_widget(self.anadugme)
 
        return duzen
开发者ID:mbaser,项目名称:kivy-tr,代码行数:34,代码来源:dropdown-simple-son.py

示例7: build

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
 def build(self):
     self.title = 'Quick-Keys'
     self.icon = '1479186122476.png'
     Window.size = (winheight, winwidth)
     parent = FloatLayout()
     #parent.size = Window.size
     for i in range(len(symbols)):
         #btn[i] = Button(text = symbols[str(i+1)], size_hint = (widspacex, widspacey), pos_hint = widspaces[i])
         #btn[i].bind(on_press = callback)
         #parent.add_widget(btn[i])
         popup[i] = Popup(title = 'replace ' + symbols[str(i + 1)] + ' with',
                          content = TextInput(text = symbols[str(i+1)],
                          multiline = False))
         #print popup[i].content.text
         popup[i].bind(on_dismiss = popup_callback) #newSymbol(str(i+1), popup[i].content.text))
         btn[i] = addbutton(symbols[str(i+1)], (widspacex, widspacey), widspaces[i], popup[i].open, parent)
     
     serports = serial_ports()
     #print len(serports)
     port = DropDown()
     for i in range(len(serports)):
         dropbtn = Button(text = serports[i], size_hint_y = None, height = 44)
         dropbtn.bind(on_release = lambda dropbtn: port.select(dropbtn.text))
         port.add_widget(dropbtn)
         
     portbtn = Button(text = ser.port, size_hint = (2/3, widspacey), pos_hint = {'x' : 0, 'y' : 0})
     portbtn.bind(on_release = port.open)
     port.bind(on_select=lambda instance, x: setattr(portbtn, 'text', x))
     parent.add_widget(portbtn)
     applybtn = addbutton('save', (1/3, widspacey), {'x' : 2/3, 'y' : 0}, callback, parent)
     #applybtn.bind(on_press = ser
     #applybtn = Button(text = 'apply', size_hint = (1/3, widspacey), pos_hint = {'x' : 2/3, 'y' : 0})
     #applybtn.bind(on_press = callback)
     #parent.add_widget(applybtn)
     return parent
开发者ID:stuffandahalf,项目名称:Quick-Keys,代码行数:37,代码来源:Quick-Keys_Kivy_App.py

示例8: addDetails

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
def addDetails(*args):
	print("In procedure to add details")
	gridlayout = args[0]
	btn_add = args[1]
	label = Label(text="Argument Value Type: ",color=(1,0,0,1),font_size=10)
	label2 = Label(text="Default Argument Parameter: ",color=(1,0,0,1),font_size=10)
	label3 = Label(text="Default Value",color=(1,0,0,1),font_size=10)
	textInput = TextInput(id="textInputIDForDefaultArgParameter")
	textInput2 = TextInput(id="textInputIDForDefaultValue")
	gridlayout.add_widget(label)
	btnMain = Button(text="ValueType",id="valueTypeID")	
	gridlayout.add_widget(btnMain)
	gridlayout.add_widget(label2)
	gridlayout.add_widget(textInput)
	gridlayout.add_widget(label3)
	gridlayout.add_widget(textInput2)
	kindOfValues = ['ABP','NSR','NER','STR','NBR']
	dropdown = DropDown()
	for eachType in kindOfValues:
		btn_tmp = Button(text=eachType, size_hint_y=None, height=20)
		btn_tmp.bind(on_release=lambda btn_tmp: dropdown.select(btn_tmp.text))
		dropdown.add_widget(btn_tmp)
			
	btnMain.bind(on_release=dropdown.open)
	dropdown.bind(on_select=lambda instance, x: setattr(btnMain,'text',x))
	
	btn_add.disabled = False
开发者ID:arkobasu0713,项目名称:CompleteFramework,代码行数:29,代码来源:dynamicUtilsUI.py

示例9: addButtons

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
 def addButtons(self):
     for i, button_text_label in enumerate(self.buttonList):
         temp_button = MyButton(text = button_text_label)
         #if these two colors are not redefined in the inherited class, the default is used
         temp_button.color = self.menu_color_letters
         temp_button.background_color =  [.8, .7,0, .9]
         #now add dropdown buttons
         dropdown = DropDown()
         #if in parameter settings, combine dict to string
         if i is 1:
             for y in self.paradigm_setup_values:
                 submenu_string = y+': '+str(self.paradigm_setup_values[y])
                 btn = Button(text=submenu_string, size_hint_y=None, height=44)
                 btn.background_color =  [.8, .9,.7, .9]
                 btn.bind(on_release=lambda btn: dropdown.select(btn.text))
                 dropdown.add_widget(btn)
         else:
             for submenu_string in self.menu_items[i]:
                 # when adding widgets, we need to specify the height manually (disabling
                 # the size_hint_y) so the dropdown can calculate the area it needs.
                 btn = Button(text=submenu_string, size_hint_y=None, height=44)
                 btn.background_color =  [.8, .9,.7, .9]
                 # for each button, attach a callback that will call the select() method
                 # on the dropdown. We'll pass the text of the button as the data of the
                 # selection.
                 btn.bind(on_release=lambda btn: dropdown.select(btn.text))
                 #then add the button inside the dropdown
                 dropdown.add_widget(btn)
         #bind the dropdown to the main menu button
         temp_button.bind(on_release = dropdown.open) 
         dropdown.bind(on_select=lambda instance, x: self.menu_function_handler(x))
         #get info about what has been pressed
         #dropdown.bind(on_select=lambda instance, x: setattr(temp_button, 'text', x))
         self.layout_top_menu.add_widget(temp_button)
开发者ID:ninehundred1,项目名称:TouchBehaviorApp,代码行数:36,代码来源:TouchTraining.py

示例10: Uygulama

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
class Uygulama(App):
    def secim(self,nesne):
        if nesne.text=="mavi":
            self.resim.color=(0,0,1,1)
        elif nesne.text=="kirmizi":
            self.resim.color=(1,0,0,1)
        elif nesne.text=="yeşil":
            self.resim.color=(0,1,0,1)
        self.dropdown.select(nesne.text)
        self.anaDugme.text=nesne.text
    def build(self):
        self.renkler=(["mavi"],["kirmizi"],["yeşil"])
        duzen=BoxLayout()
        self.dropdown=DropDown()
        self.resim=Image()
        for renk in self.renkler:
            dugme=Button(text=renk[0],size_hint_y=None,height=50)
            dugme.bind(on_relase=self.secim)
            self.dropdown.add_widget(dugme)
        self.anaDugme=Button(text="Renkler",size_hint=(None,None))
        self.anaDugme.bind(on_relase=self.dropdown.open)
        duzen.add_widget(self.anaDugme)
        duzen.add_widget(self.resim)

        return duzen
开发者ID:mustafa-altinisik,项目名称:test2,代码行数:27,代码来源:dropdown.py

示例11: __init__

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
 def __init__(self,*args,**kwargs):
     super(MenuScreen, self).__init__(*args, **kwargs)
     self.drop_down = CustomDropDown()
     notes_dropdown = ObjectProperty(None)
     dropdown = DropDown()
     notes = ['Features', 'Suggestions', 'Abbreviations', 'Miscellaneous']
     for note in notes:
         # when adding widgets, we need to specify the height manually (disabling
         # the size_hint_y) so the dropdown can calculate the area it needs.
         btn = Button(text='%r' % note, size_hint_y=None, height=30)
         # for each button, attach a callback that will call the select() method
         # on the dropdown. We'll pass the text of the button as the data of the
         # selection.
         btn.bind(on_release=lambda btn: dropdown.select(btn.text))
         # then add the button inside the dropdown
         dropdown.add_widget(btn)
     # create a big main button
     mainbutton = Button(text='Usage Notes 2', size_hint=(1, 1))
     # show the dropdown menu when the main button is released
     # note: all the bind() calls pass the instance of the caller (here, the
     # mainbutton instance) as the first argument of the callback (here,
     # dropdown.open.).
     mainbutton.bind(on_release=dropdown.open)
     #dd_btn.bind(on_release=dropdown.open)
     # one last thing, listen for the selection in the dropdown list and
     # assign the data to the button text.
     dropdown.bind(on_select=lambda instance, x: setattr(mainbutton, 'text', x))
     #dropdown.bind(on_select=lambda instance, x: setattr(dd_btn, 'text', x))
     self.top_layout.add_widget(mainbutton)
开发者ID:JosephLee19,项目名称:InteractiveProgramming-1,代码行数:31,代码来源:GUI.py

示例12: make_dropdown

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
def make_dropdown(labels, callback, width = 80, line_height = 30):
    dropdown = DropDown(auto_width=False, width=width)
    for name in labels:
        btn = Button(text=str(name), size_hint_y=None, height=line_height)
        btn.bind(on_release=lambda btn: dropdown.select(btn.text))
        dropdown.add_widget(btn)
    dropdown.bind(on_select=callback)
    return dropdown
开发者ID:sbrother,项目名称:wassum-lab-lick-program,代码行数:10,代码来源:main.py

示例13: comment_pop

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
	def comment_pop(instance):
		""" Creates a Popup to Log Task into timesheet  """

		con=lite.connect('TimeTracker.db')
		with con:
		    cur=con.cursor()
		    cur.execute("SELECT DISTINCT TASK FROM Timesheet ORDER BY TASK ")
		    rows = cur.fetchall()
		    task_list=['OTHER']
		    for row in rows:
				task_list.append(row[0])
		if con:
		    con.close()
		f=FloatLayout()
		global popup1
		popup1 = Popup(title='Task Desciption',
		content=f,
		size_hint=(1.0, 0.6), size=(400, 400))
		g=GridLayout(cols=2,row_force_default=True, row_default_height=40,
					 padding=(1,0,1,0))
		g.add_widget(Label(text="SELECT TASK ",pos=(400,800)))
		global task
		task=TextInput(size_hint=(1,0.75),write_tab=False,text_size=(2,None))
		dropdown = DropDown()
		for index in range(len(rows)+1):
		    btn = Button(text=task_list[index], size_hint_y=None, height=44)
		    btn.bind(on_release=lambda btn: dropdown.select(btn.text))
		    dropdown.add_widget(btn)
		global mainbutton
		mainbutton = Button(text='TASK', size_hint=(None, None),size=(100, 44),
							pos_hint={'center_x': .5, 'center_y': .5})
		mainbutton.bind(on_release=dropdown.open)
		dropdown.bind(on_select=MyApp.select_task)
		g.add_widget(mainbutton)
		g.add_widget(Label(text="ADD TASK",pos=(400,600)))
		g.add_widget(task)
		g.add_widget(Label(text="COMMENTS",pos=(400,400)))
		global comment
		comment=TextInput(size_hint=(1,0.75),write_tab=False)
		g.add_widget(comment)
		global msg
		msg=Label(text="Please enter the task and comment to save the task \n",
				  pos=(popup1.width-350,popup1.height-200))
		comment.bind(on_text=
					 msg.setter("Please enter the task and comment to save the task \n"))
		btn1=Button(text='SAVE',size_hint=(0.2,0.1),pos=(popup1.width-350,
					popup1.height-250))
		btn1.bind(on_press=MyApp.update_timesheet)
		btn2=Button(text='CANCEL',size_hint=(0.2,0.1),
					pos=(popup1.width-50,popup1.height-250))
		f.add_widget(msg)
		f.add_widget(btn1)
		f.add_widget(btn2)
		f.add_widget(g)
		popup1.open()
		btn2.bind(on_press=popup1.dismiss)
开发者ID:rev20,项目名称:Time-Tracker,代码行数:58,代码来源:main.py

示例14: __init__

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
    def __init__(self, **kwargs):
        super(UpdateScreen, self).__init__(**kwargs)
        self.cols = 2

        dropDown = DropDown()
        for index in range(10):
            btn = Button(Text="Value %d" % index, size_hint_y=None, height=44)
            dropDown.add_widget(btn)

        self.add_widget(dropDown)
开发者ID:riyaan,项目名称:ekkamai,代码行数:12,代码来源:kivyUpdate.py

示例15: LeaderBoardLayout

# 需要导入模块: from kivy.uix.dropdown import DropDown [as 别名]
# 或者: from kivy.uix.dropdown.DropDown import add_widget [as 别名]
class LeaderBoardLayout(Widget):
    def __init__(self, **kwargs):
        """ Creates the buttons, text inputs and labels to be used by the other functions
        :param kwargs:
        :return:
        """
        super(LeaderBoardLayout, self).__init__(**kwargs)
        self.choice_button = Button(text="Get results")
        self.results_label = Label(text="High scores", font_size="20sp")
        self.name_input = TextInput(text="Enter username here.", multiline=False)
        self.options_dropdown = DropDown()
        self.dropdown_button = Button(text="Select an option")
        self.dropdown_button.bind(on_release=self.options_dropdown.open)
        self.layout = GridLayout(rows=5)
        self.drop_down_options = ["Top 10 Scores", "Add New User", "Top scores for user"]
        self.selected_url = "None"

    def create_layout(self):
        """Adds the objects created in __init__ to a GridLayout and creates a drop down
        :return:
        """
        self.choice_button.bind(on_press=self.callback)

        for d in self.drop_down_options:
            btn = Button(text=d, size_hint_y=None, height=44)
            btn.bind(on_release=lambda btn: self.options_dropdown.select(btn.text))
            self.options_dropdown.add_widget(btn)
        self.options_dropdown.bind(on_select=lambda instance, x: setattr(self.dropdown_button, "text", x))

        self.layout.add_widget(self.dropdown_button)
        self.layout.add_widget(self.name_input)
        self.layout.add_widget(self.choice_button)
        self.layout.add_widget(self.results_label)
        return self.layout

    def server_results(self, request, results):
        """ Outputs the request result into a label
        """
        self.results_label.text = str(results)

    def callback(self, event):
        """Depending on which drop down option was selected a request a URL is
        chosen to request data from teh server. """
        playername = self.name_input.text[:3]
        self.name_input.text = playername
        self.results_label.text = "Getting scores"

        if self.dropdown_button.text == "Top 10 Scores":
            self.selected_url = "http://bsccg04.ga.fal.io/top10.py"
        elif self.dropdown_button.text == "Add New User":
            self.selected_url = "http://bsccg04.ga.fal.io/new_user.py?playername=" + playername
        elif self.dropdown_button.text == "Top scores for user":
            self.selected_url = "http://bsccg04.ga.fal.io/users_high_score.py?playername=" + playername

        request = UrlRequest(self.selected_url, self.server_results)
开发者ID:MaddieK19,项目名称:comp-130-mobile-game-app,代码行数:57,代码来源:Leaderboard.py


注:本文中的kivy.uix.dropdown.DropDown.add_widget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。