Re: GtkGrid design document



El jue, 15-04-2004 a las 17:44, Murray Cumming escribió:
> On Thu, 2004-04-15 at 11:28, Lorenzo Gil Sanchez wrote:
> > * Differences with GtkTreeView
> > 
> > - GtkGrid is designed for *fast* editing of the model. This means you
> >   don't have to go to a cell, activate it to enter the edit mode, edit
> >   the cell, press enter again to commit your changes and repeat all
> >   these keystrokes in the next cell. This behavior is fine if you just
> >   need to edit a few cells in your TreeView but if you want to edit
> >   almost every cell this is a pain.
> > 
> > - GtkGrid looks like a table (e.g. it paints horizontal and vertical
> >   lines to separate cells).
> 
> Why can't these just be enhancements to GtkTreeView? It doesn't seem
> sensible that I should use a whole other widget just because I want
> focus to jump to the next cell quickly, or if I want lines between the
> cells.

Before I wrote the GtkGrid I did try to do what you say with the
GtkTreeView. I won't say it is impossible but I found it to be really
hard and a lot of code should be changed. I talked with owen and jrb
throgh IRC and they told me GtkTreeView was not designed for fast
editing and it was already a too big widget to change it. Just
GtkTreeView and GtkTreeViewColumn are more than 16K lines and that seems
a lot for me.

We can take a look at other toolkits like Qt and Swing. I'm not saying
we should copy them but I think we should learn from them.

Another reason would be easy of use. It may be great to have a super
widget but for my experience most newbies found GtkTreeView a real hard
one to use. Sure, we could improve Glade to have a Tree Editor but
still, I don't think we should complicate it.

> 
> > - You can not pack more than one CellRenderer in a GridColumn. I'm not
> >   sure about this design decision but to me it doesn't make sense to
> >   have more than one renderer by cell since the purpose of the grid is
> >   to edit data.
> 
> I don't know why we would create another widget just to have a widget
> that can do less. This point does'nt seem useful.

As I said I'm not sure about this issue and maybe we can have more
renderers for column but the question is: does it make sense? Remember
that the Grid main purpose is data editing, not data displaying. If we
have two renderers in one column and I got to that cell, should I handle
them like two independent cells? should both be editable? only one?
Again, I'm not sure about this.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]