To: lablgtk at math.nagoya-u.ac.jp Subject: How to make text wrap into a GTK Tree View? From: David MENTRE Organization: none Date: Sat, 23 Apr 2005 17:09:46 +0200 Message-ID: <87u0lxy1fp.fsf at linux-france.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hello, I have a GTK Tree View widget with two columns: an integer column and a text column. The text in the second column can be quite long and I would like it to wrap such as to fit the text column width. Is there any way to do that? In picture, I currently have: |007 | A quite long text that| <[ ]------------------> And I would like to have: |007 | A quite long text that| should wrap according | to the wolumn width | <[ ]> More details on my code. I'm using following code to create the view: let connect_question_view ~view ~backend = (* id column *) let col = GTree.view_column ~title:"id" ~renderer:(GTree.cell_renderer_text [], ["text", backend#col_id]) () in ignore(view#append_column col); (* descriptor column *) let col = GTree.view_column ~title:"descriptor" ~renderer:(GTree.cell_renderer_text [], ["text", backend#col_desc]) () in ignore(view#append_column col); view#selection#set_mode `SINGLE; view#set_model (Some backend#store#coerce) And I'm using following code to add a new entry in the columns: let add_question_row backend (id, desc) = let store : GTree.list_store = backend#store in let iter = store#append () in store#set ~row:iter ~column:backend#col_id id; store#set ~row:iter ~column:backend#col_desc desc Many thanks in advance, Yours, david -- pub 1024D/A3AD7A2A 2004-10-03 David MENTRE 5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A