Re: Question about how to start editing GTree.cell_renderer_text's in some easy and safe way...

Jacques Garrigue <[email protected]> Fri, 04 Jun 2010 14:50:13 +0900 (JST)
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
From: "Stalkern 2 (Fastweb)" <[email protected]>
> I was looking at the tree.ml example provided with lablgtk2 and I was
> modifying it so to get cell editing just as soon as cursor is moved to
> an editable cell, without needing to activate the row or press the
> [Space] key or the [Return] key.

[...]

> Indeed, I notice *no difference* between the behaviour obtained writing
> 
> --8<----8<----8<----8<----8<----8<----
> 	view#set_cursor
> 		~cell:authorCellrenderer
> 		~edit:false
> 		p
> 		(view#get_column 1)
> ---->8---->8---->8---->8---->8---->8--
> 
> and the one obtained writing
> 
> --8<----8<----8<----8<----8<----8<----
> 	view#set_cursor
> 		~cell:authorCellrenderer
> 		~edit:true
> 		p
> 		(view#get_column 1)
> ---->8---->8---->8---->8---->8---->8--
> 
> I've been noticing this using lablgtk 2.10.1 with glib-2.0 version
> 2.20.0 and gtk+-2.0 version 2.14.7.

Same for me with lablgtk-2.14.1, glib-2.24.1 and gtk+-2.20.1.
When the application comes up, the first line is selected, and put in
editing mode, but when the selection moves, one has to activate
edition manually.

Very strange indeed. I don't think this is lablgtk related, as
the wrappers seems to be working as expected. Rather some strange
interaction inside gtk. Is somebody else disactivating the edition...

By the way, the behaviour is a bit clearer if the model is updated:

  authorCellrenderer#connect#edited ~callback:
    begin fun p s ->
      model#set ~row:(model#get_iter p) ~column:author s
    end;

I.e. this is only a problem of switching edition on. But I don't know
how to do that...

Jacques