Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy layout selection issue

I'm going to create a Kivy UI for my robot project, my only problem is working with layouts, I'm confused to it.

I'll attach GUI image that I want to create layout for it in Kivy please guide what is best choice (BOX, Grid, Relative,..) I know I must mix them and use 2 or more layout together but I can't select correctly, I read Kivy documentation and I tried to use Kivy Designer but still I couldn't choose best layouts. Maximum window size is 800x600.

GUI 800x600

like image 344
A.M Avatar asked Oct 30 '22 12:10

A.M


1 Answers

I would prefer the SimpleTableLayout, it's a widget available in Kivy Garden: Simple Table Laout - Kivy Garden

If you don't know how to use Kivy-Garden here are the installation instructions: How to install kivy garden

The SimpleTableLayout supports row and column spanning as well as getting the widget of a certain cell: SimpleTableLayout.cell(row, col)

A little example for your App:

<SimpleTableLayout>:
    rows:10
    cols:14

    <Gauge1>:
        rowspan:2
        colspan:2

    <SpaceHolderWidget>:
        rowspan:12

    <SpaceHolderWidget>:
        colspan: 2

    <SmallGauge1>:

    <SpaceHolderWidget>:

    <SmallGauge2>:

    <SpaceHolderWidget>:
        colspan:2

    <SpaceHolderWidget>:
        rowspan:12

    <Gauge2>:
        rowspan:2
        colspan:2

    <Canvas>:
        rowspan:5
        colspan:7
like image 157
user8128255 Avatar answered Nov 26 '22 07:11

user8128255