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

"Stalkern 2 (Fastweb)" <[email protected]> Fri, 04 Jun 2010 16:22:16 +0200
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
Jacques Garrigue wrote:
> 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...

If I start typing words before the cell is edited, there is a kind of
text entry popping up. What is it?

For peace of mind, I wanted to recompile GTK2 with the option
--disable-xim as found in
http://library.gnome.org/devel/gtk/unstable/gtk-building.html, but it
just stopped telling me:

	configure: WARNING: unrecognized options: --disable-xim

so concerning XIM, my mind rests in peace.

> 
> 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
> 

Well, if *YOU* don't know, chances are little that I ever discover it...

maybe the program could play a double-click after setting the cursor on
the cell? I could not find a way to do so with lablgtk2 so far, but I
stopped after a few (...less than a hundred ;-)) ) trials.

:-))

Ernesto