unable to make a simple grid layout with 4 buttons

33 views
Skip to first unread message

dimple verma

unread,
Jan 16, 2017, 12:59:38 AM1/16/17
to Kivy users support
i am a newbie to kivy,trying to make a simple screen using gridlayout with 4 buttons using kivy language .i am attaching the files of my code but i am getting the error as follows:
   File "/usr/lib/python3/dist-packages/kivy/lang.py", line 1440, in parse_level
     'Invalid data after declaration')
 kivy.lang.ParserException: Parser: File "/home/dimple/ucoe.kv", line 4:
 ...
       2:    GridLayout:
       3:        cols:2
 >>    4:    row_force_default:True
       5:    row_default_height:40
       6:   
 ...
 Invalid data after declaration
ucoe.kv
ucoe.py

Oon-Ee Ng

unread,
Jan 16, 2017, 4:23:21 PM1/16/17
to kivy-...@googlegroups.com
Fix your editor, your kv file is a mess of spaces/tabs.

The specific error you're having is because your row_force_default and
row_default_height isn't in the right place. Actually I think you may
be trying to add a gridlayout to a gridlayout... Remove lines 2 from
ucoe.kv and un-indent the cols: 2 line. Also fix your 'width=100' to
'width:100' and it'll run.
> --
> You received this message because you are subscribed to the Google Groups
> "Kivy users support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kivy-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

dimple verma

unread,
Jan 19, 2017, 10:44:34 AM1/19/17
to Kivy users support
Thanks for your reply sir,

The code worked but not properly ,i am attaching the screenshot of how it looks.Please help!

Regards
newbie

 
Screenshot from 2017-01-19 21-11-03.png

ZenCODE

unread,
Jan 19, 2017, 4:14:20 PM1/19/17
to Kivy users support
Oon-Ee Ng was pretty much spot on. Tabs/spaces andgrids within grids. Please find corrected files attached :-)
ucoe.kv
ucoe.py
Reply all
Reply to author
Forward
0 new messages