Date: Tue, 08 Mar 2005 10:36:26 +0100 (CET) Message-Id: <20050308.103626.59669447.andrieu at ijm.jussieu.fr> To: aubineth at ccs.neu.edu Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: tree view models written in ocaml From: Olivier Andrieu In-Reply-To: References: <20050303234255.GA25179 at furbychan.cocan.org> <20050304.105749.112609272.andrieu@ijm.jussieu.fr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ethan Aubind [Sun, 6 Mar 2005]: > If update a row in the model, the tree is only redrawn when clicked > on, or when a new row is added. It seems like you've stored a mutable caml value in the model (for instance, a record with mutable fields) and that you're mutating the value directly. Indeed GTK+ cannot update the view when such changes happen behind its back. > Whats the best way to ensure that the displayed contents of the > view is synched w/ the content of the model? You can : - re-assign the updated value in the model, using GTree.list_store#set or GTree.tree_store#set or, - directly tell the model that a row has been updated by calling GTree.model#row_changed This will make the model emit the "row-changed' signal, to which the view is connected. It (the view) will then update itself to reflect the change. Perhaps calling `view#misc#draw None' will work too, but that's not very elegant. -- Olivier