Re: Freezing a GtkTreeView



On Thursday 06 November 2003 16:27, Dimitar Haralanov wrote:

Hi Dimitar,

as far as I know there are not freeze/thaw functions for GtkTreeView.
However, does anyone know how I can achieve this effect. The problem
that I am trying to solve is the following: Some of the columns of my
GtkTreeView are editable so the user can click on the cell and be able
to edit it.
    However, the treeview gets updated all the time. What happens at
    that point is that the user clicks on the cell, the cell becomes editable
but as soon as there is an update to the TreeView, the cell switches
back.
    One way to accomplish this is to keep track if any of the editable 
    cells become active and start queueing up all the changes to the
ListStore until the cell gets deactivated but I was wondering whether
there is a way to do that by just turning off the TreeView updated and
not the ListStore

      A few days ago I posted this question and I haven't seen any replies. I
was just wondering whether no one knows or no one has seen the
message?

Here are some ideas then (the usual disclaimer applies):

* You could try to block the "row-changed" signal of the model while in 
editing mode, so that the data will be changed, but the tree view will not be 
notified of changes (no idea whether this works) (this is assuming that it is 
the "row-changed" signal which stops the editing, which I haven't verified, 
it's just a guess).

* You could write a custom model that doesn't emit the "row-changed" signal 
while the tree view is in editing mode (in case the above is not possible).

* You could maintain two identical models (or make a copy of the model when 
editing starts) and only update the model that is not attached to a tree view 
during editing. Then, when the editing is done, you just put the entered 
value into the 'background' model, and switch models.

Cheers
-Tim




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