Random column number set in one gridlayout

Martin

test.py

import sqlite3 as lite

from kivy.uix.screenmanager import Screen
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window

Window.size = (600, 325)

class UserGroup(Screen):
    pass


class FactUserGroup(App):

    def build(self):
        self.root = Builder.load_file('test.kv')
        return self.root


if __name__ == '__main__':
    FactUserGroup().run()

test.kv

<CustomLabel@Label>:
    text_size: self.size
    valign: "middle"
    padding_x: 5

<SingleLineTextInput@TextInput>:
    multiline: False

<GreenButton@Button>:
    background_color: 1, 1, 1, 1
    size_hint_y: None
    height: self.parent.height * 0.120

UserGroup

    GridLayout:
        cols: 2
        padding : 30,30
        spacing: 20, 20
        row_default_height: '30dp'

        Label:
            text: 'Male'
            text_size: self.size
            valign: 'middle'

        CheckBox:
            group: 'check'
            id : chk


        Label:
            text: 'Female'
            text_size: self.size
            valign: 'middle'

        CheckBox:
            group: 'check'

        CustomLabel:
            text: 'age'
            text_size: self.size
            valign: 'middle'

        SingleLineTextInput:
            id: age


        GreenButton:
            text: 'Ok'


        GreenButton:
            text: 'Cancel'
            on_press: app.stop()

enter image description here (

 How to set male,female in one row in same GridLayout.If i use two gridlaout first set cols: 4 and second set cols: 2 and show in pop up then it gives error "Popup can have only one widget as content".So how to set in one GridLayout with first row with 4 cols and second row 2 cols.

el3ien

You cannot do that with gridlayout alone.

You could make a gridlayout with two columns, and put horizontal boxlayouts in the grid you need to split.

Or you could use stacklayout. stacklayout

I would just use two gridlayouts inside a vertical boxlayout.

You simply put both gridlayouts in a boxlayout. So the Popup will contain the boxlayout, and won't complain about multiple widgets.

MyBoxLayout:
    orientation: "vertical"

    GridLayout1:
        cols: 2
    GridLayout2:
        cols: 4

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to set auto column in gridlayout of recycleview?

From Dev

Set random negative number with Random Functions in Jmeter?

From Dev

Selected a random number from a set

From Dev

Add column with random number based on other column

From Java

Random number generator only generating one random number

From Dev

Generating random number for specific column in table

From Dev

Sql Server Updating column by generating random number

From Dev

one random number generator vs six

From Dev

Turning a random number generating loop into a one equation?

From Dev

Python random number excluding one variable

From Dev

Random integer in a certain range excluding one number

From Dev

How to set the number of trees in OpenCV random tree?

From Dev

put random position set of number with conditional repeat

From Dev

Averaging by column for set number of rows

From Dev

GridView Set Fixed Column Number

From Dev

Random subsets in function of one column in r

From Dev

R: random sample of columns excluding one column

From Dev

Numerate SQL column values and pick a random one

From Java

Decrease the width of column in a GridLayout

From Dev

Generating a random double number with one number decimal point

From Dev

Generating a random double number with one number decimal point

From Dev

Generating set of random elements with further generation of 'one by one'

From Dev

LinearLayout inside the second column of a GridLayout overflows the screen when width set to match_parent

From Dev

LinearLayout inside the second column of a GridLayout overflows the screen when width set to match_parent

From Dev

Display one number in a column of repeating numbers

From Dev

Matrix with at least one number in every row and column

From Dev

Changing number of columns in RecyclerView gridlayout

From Dev

Set a range to an entire column with index number

From Dev

VBA - merge set number of rows in first column

Related Related

  1. 1

    How to set auto column in gridlayout of recycleview?

  2. 2

    Set random negative number with Random Functions in Jmeter?

  3. 3

    Selected a random number from a set

  4. 4

    Add column with random number based on other column

  5. 5

    Random number generator only generating one random number

  6. 6

    Generating random number for specific column in table

  7. 7

    Sql Server Updating column by generating random number

  8. 8

    one random number generator vs six

  9. 9

    Turning a random number generating loop into a one equation?

  10. 10

    Python random number excluding one variable

  11. 11

    Random integer in a certain range excluding one number

  12. 12

    How to set the number of trees in OpenCV random tree?

  13. 13

    put random position set of number with conditional repeat

  14. 14

    Averaging by column for set number of rows

  15. 15

    GridView Set Fixed Column Number

  16. 16

    Random subsets in function of one column in r

  17. 17

    R: random sample of columns excluding one column

  18. 18

    Numerate SQL column values and pick a random one

  19. 19

    Decrease the width of column in a GridLayout

  20. 20

    Generating a random double number with one number decimal point

  21. 21

    Generating a random double number with one number decimal point

  22. 22

    Generating set of random elements with further generation of 'one by one'

  23. 23

    LinearLayout inside the second column of a GridLayout overflows the screen when width set to match_parent

  24. 24

    LinearLayout inside the second column of a GridLayout overflows the screen when width set to match_parent

  25. 25

    Display one number in a column of repeating numbers

  26. 26

    Matrix with at least one number in every row and column

  27. 27

    Changing number of columns in RecyclerView gridlayout

  28. 28

    Set a range to an entire column with index number

  29. 29

    VBA - merge set number of rows in first column

HotTag

Archive