Table widget?

4,485 views
Skip to first unread message

zw g

unread,
Oct 11, 2012, 12:49:41 AM10/11/12
to kivy-...@googlegroups.com
Hi guys,


Is there any table related widgets in Kivy framework?
I want to write an audio player. I need a table or something like that to display playlist.

Any suggestion?
Thanks in advance.


Gui

Gabriel Pettier

unread,
Oct 11, 2012, 2:34:52 AM10/11/12
to kivy-...@googlegroups.com
Something like BoxLayout or GridLayout?
> --
>
>

zw g

unread,
Oct 11, 2012, 3:34:46 AM10/11/12
to kivy-...@googlegroups.com
No, it's more like a excel sheet widget with rows & colomns & headers elements.
Which is suitable for all kinds of information for a song, suck as: Title, Album, Artist, Duration, Genre....

I know a bit skills of PyQt4.  (Compare to Kivy, it's more matured, but without support for iOS & Android.)
In PyQt4 there are two widgets:
1) QTableWidget
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qtablewidget.html

2) QTableView
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qtableview.html

You can see some screenshots in the above links.


Gui


--



Gabriel Pettier

unread,
Oct 11, 2012, 5:49:57 AM10/11/12
to kivy-...@googlegroups.com
Ok, no, we don't have things of that kind, you can emulate that with a
GridLayout with buttons in the first row (to sort the subsequent rows
based on current column) and labels (or buttons if you want to start an
action on click on them) for the next rows, and put the whole thing in
a ScrollView if you want the scroll thing, it shouldn't be very hard to
do, create an update() callback that can sort your data based on the
index of your row and fill the the table with the good elements, kivy
widgets are lower level than Qt ones, but they are flexible enought
it's not too much work to do that.

If you do the TableWidget generic enough, it could be a welcome
addition to kivy widgets :)

If you have troubles doing it, we'll try to help :)
> --
>
>


zw g

unread,
Oct 11, 2012, 8:44:26 AM10/11/12
to kivy-...@googlegroups.com
It's good to know these.
Thank you very much.

Gui


--



happybeej

unread,
Sep 18, 2013, 1:15:03 PM9/18/13
to kivy-...@googlegroups.com
Been researching about this and found this message, and was able to emulate all of that except for one thing. I can't change the scrollbar to the traditional one. Was able to make it visible thanks to other information here, but its not clickable. Meaning I can't control the scroll using the bar.

Any ideas how to do this? My vague idea is to check on_press_down if it is within the area of the scrollbar and write code to scroll it down. But maybe there is another way?

Gabriel Pettier

unread,
Sep 18, 2013, 7:13:31 PM9/18/13
to kivy-...@googlegroups.com
I think that's the idea. I would check for position in on_touch_down,
grab the touch to get updates (on_touch_move), and in on_touch_move,
would check for touch.dsy (vertical difference between last event,
relative to widget size[1]), and scroll accordingly. Don't forget to
ungrab the touch in on_touch_up.

Good luck.

[1] http://kivy.org/docs/api-kivy.input.motionevent.html
> > > <gabriel...@gmail.com <javascript:> <mailto:gabriel...@gmail.com<javascript:>>>
> > wrote:
> > >
> > > Something like BoxLayout or GridLayout?
> > >
> > >
> > > On jeu. 11 oct. 2012 06:49:41 CEST, zw g wrote:
> > >
> > > Hi guys,
> > >
> > >
> > > Is there any table related widgets in Kivy framework?
> > > I want to write an audio player. I need a table or something
> > > like that
> > > to display playlist.
> > >
> > > Any suggestion?
> > > Thanks in advance.
> > >
> > >
> > > Gui
> > >
> > > --
> > >
> > >
> > >
> > > --
> > >
> > >
> > >
> > > --
> > >
> > >
> >
> >
> >
>
> --
> 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/groups/opt_out.

Pedro Couto

unread,
Sep 18, 2013, 10:42:13 PM9/18/13
to kivy-...@googlegroups.com
I've been working on something like that, reuse the code for your needs if you want to.

Here:

I'm still developing it, but i will make it more usable, in fact, i've already got a version, but it needs some adjustments yet, in the meanwhile, take a look at it.

Best regards,

Pedro Couto

happybeej

unread,
Sep 19, 2013, 2:13:52 AM9/19/13
to kivy-...@googlegroups.com
Thank you all!

Will try to create the functions for the scrollbar.

And thank you for the code! That helps a lot

Bernardo

Jasmal Py

unread,
Jul 28, 2015, 1:55:26 AM7/28/15
to Kivy users support, gabriel...@gmail.com
hi,

How can i loop thru gridlayout for reading values for insert to database

Federico Curzel

unread,
Jul 28, 2015, 2:44:07 AM7/28/15
to Kivy users support, gabriel...@gmail.com
Check also out my project : https://github.com/Cuuuurzel/kivy-pro-grid
I was able to also run it smoothly on mobile.
You can customize column sizes and colors.

--
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.

Jasmal Py

unread,
Jul 28, 2015, 6:49:11 AM7/28/15
to Kivy users support, gabriel...@gmail.com, fcur...@gmail.com
Hi Federico,
Wile running demo i got following error

   File "C:\Users\softx2\Desktop\kivy-pro-grid-master\progrid\progrid.py", line
381, in _gen_header
     text = u' '+text if first_col else text
 TypeError: Can't convert 'bytes' object to str implicitly

Fredrik Averpil

unread,
Nov 24, 2015, 1:26:09 PM11/24/15
to Kivy users support
Old topic, but I have to ask... are there no plans on developing something similar to PyQt's QTableWidget?
This is actually one thing holding me off attempting to port my PyQt/PySide application to Kivy as I am using QTableWidgets extensively.

Think of a table widget as an Excel/Google Sheets document. There are rows and columns making up the table of cells. Then you can set this table to e.g. hide the colum header or row header, you can choose whether a selection selects the whole row, whether the cells can be edited etc... any way, very useful.

What are the current workarounds?

Regards,
Fredrik

Lorenzo Simonassi

unread,
Aug 15, 2016, 9:03:08 PM8/15/16
to Kivy users support
Any update? I still stuck on pyqt because of tablewidget :/

Johnny T

unread,
Sep 21, 2018, 9:56:51 AM9/21/18
to Kivy users support
That is some very useful information. But what can I do if I want my first row to be visible all the time? (a.k.a. not scroll with the rest of the rows)

Will Tejeda

unread,
Sep 21, 2018, 11:20:03 AM9/21/18
to kivy-...@googlegroups.com
I’d guess that you’d have two layouts inside the grid layout 

GridLayout:
    
    Grid Layout:
        Button:
        Button:
        Button:
        Button:

    Scrollview: 
        Gridview:
            Playlist items

--
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.

Wim van de Brug

unread,
Sep 21, 2018, 4:52:49 PM9/21/18
to Kivy users support
Although old post but due to recent activity I just want to share the following extension based on kivyMD with you: https://gitlab.com/zuhaib/KivyMD/tree/feature/DataTable


Op donderdag 11 oktober 2012 06:49:41 UTC+2 schreef Mr.Gui:
Reply all
Reply to author
Forward
0 new messages