zoukankan      html  css  js  c++  java
  • kivy Grid Layout

    http://kivy.org/docs/api-kivy.uix.gridlayout.html?highlight=gridlayout#kivy.uix.gridlayout

    It's so nice to try this one:

    from kivy.app import App
    from kivy.uix.gridlayout import GridLayout
    from kivy.uix.label import Label
    from kivy.uix.textinput import TextInput
    from kivy.uix.button import Button
    
    class LoginScreen(GridLayout):
        
        def __init__(self, **kwargs):
            super(LoginScreen, self).__init__(**kwargs)
            #self.cols = 3       # 3 columns 
            self.rows = 3       # 3 rows 
            self.add_widget(Label(text='User Name'))        #add widget label : content User Name
            self.username = TextInput(multiline=False)      # no multiline text input support
            self.add_widget(self.username)                  #add 'username' textinput
            self.add_widget(Label(text='Pass Word'))        #add widget label : content User Name
            self.password = TextInput(multiline=False, password=True)   #password auto-hidden
            self.add_widget(self.password)
            self.btn1 = Button(text='Login', fontsize=14)
            self.add_widget(self.btn1)
        
            
            
    class MyApp(App):
        def build(self):
            return LoginScreen()
            
            
    if __name__ == "__main__":
        MyApp().run()

    I added a button down there.

    And let's see what gonna happen later.

    Change the self.rows , it inherits from the class "GridLayout"

    Let's see it would look like this:

    now we see the login button down there :D

    But we need event to be triggered when the "Login" button's pressed.

    So

  • 相关阅读:
    tf-idf 解释
    maven 下载依赖失败
    eclipse 快捷键
    线程数 QPS
    resin conf
    静态成员 生命周期
    SuperMap 9D 实时数据服务学习笔记
    SuperMap iServer 在Linux 部署中问题总结
    在SuperMap iDesktop中如何快速追加记录行?
    Landsat8 卫星数据下载
  • 原文地址:https://www.cnblogs.com/spaceship9/p/3456198.html
Copyright © 2011-2022 走看看