Re: TreeView: cell-changed signal?

On Wed, 2002-03-27 at 23:13, Jonathan Blandford wrote:
> murrayc t-online de (Murray Cumming) writes:
> > > > I'm using a GtkTreeView, with a GtkListStore model. There is a
> > > > GtkTreeModel "row_changed" signal, but I can't see how to detect when a
> > > > particular column of a row has changed. I suppose I could store a copy
> > > > of all the data and do a comparison, but that would be silly.
> > > 
> > > What do you mean by column_changed?  Do you mean a GtkTreeViewColumn has
> > > been added or removed?  There's a GtkTreeView::column_changed signal for
> > > that.  What are you trying to do?
> > 
> > No, I mean a user action. For instance, if I have a list of products, I
> > might want to know that the price of a particular product has changed,
> > rather than just knowing that _something_ about a particular product has
> > changed. I expected the row_changed signal to provide a column number as
> > well as TreeIter.
> It doesn't do that.  This was a specific design decision to not require
> deltas or column numbers.  The reason is that there's no way to know
> what the old values where anyway, so knowing the column that changed
> isn't necessarily useful unless you store the old values.

I don't think that's particularly true. The fact that something has
changed is often useful even when you don't know what the old value is. 

>  Also, the
> GtkTreeView widget can't use this information at all, so it's nicer for
> model authors to not have to provide it.

That's disappointing. It's a glaring omission compared to grid widgets
in other toolkits. But maybe that's why there are these plans for an
additional a grid/sheet widget.

Also, how should I do validation on cell value changes?

Murray Cumming
murrayc usa net

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