GUI Python interfaces and DataGrids

Maan Hamze mmhamze at pleiades.net
Sat Aug 25 17:25:20 EDT 2001


Just out of curiousity:
you said:
> In fact, at the last VB shop where I worked, use
> of data-aware controls was forbidden: we had to fill the grids
> ourselves anyway.

I use the DataGrid with Delphi 5 (I got into Delphi last year after doing
work in VB) and it does save lots of time.  Although at times I do my own
data grid.  But why was it forbidden where you work?
I can not make up my mind whether Tkinter should come with a ready datagrid
that binds to a dataset.  The dataset can be from
DatabaseQueryCursor.fetchone(), fetchmany() or fetchall().  On the other
hand, rolling our own datagrid (as I did, and as Joseph demonstrated) is
more dynamic.  And allows more freedom.  Maybe a DataGrid is for these lazy
moments when you need to demo something very fast.  I can see a problem with
a Tkinter DataGrid when it comes to selecting a particular row or pointing
to a particular row.  Here we will have integration issues between the
DataGrid and the Python DB API.  too close for comfort come to think about
it.  And maybe leaving it to the programmer to make their own DataGrid is
much better after all.
Maan

"Boudewijn Rempt" <boud at rempt.xs4all.nl> wrote in message
news:9m8uc6$jpj$1 at news1.xs4all.nl...
> Maan Hamze <mmhamze at pleiades.net> wrote:
> > Unless I am missing something, I have looked and I Tkinter does not seem
to
> > have a DataGrid to receive the rows of a query (a dataset) and display
them
> > or to bind it into a dataset.  There is the Python DB API after all.  So
I
> > believe the issue of Datasets should be standardized across the
different
> > database packages.
> > Now, I believe I have an idea on how to build a class and use it in
Python
> > that can do exactly this.
> > But does Tkinter have a DataGrid?  If not, are there any other GUI
Python
> > packages that come with a DataGrid?
>
> Not if you mean a ready-made data-aware grid control like Visual Basic
> has. You'll have to roll your own. One problem is that Tkinter, to the
> best of my knowledge doesn't have a grid control at all. I know that
> both wxPython and PyQt have a good grid control, and filling a table
> yourself from the results of a query is easy enough, and gives you a
> lot of flexibility. In fact, at the last VB shop where I worked, use
> of data-aware controls was forbidden: we had to fill the grids
> ourselves anyway.
>
> --
>
> Boudewijn Rempt  | http://www.valdyas.org





More information about the Python-list mailing list