Re: GtkSheet works on Gtk2.2 ?



Hi Tim,

Isn't it possible to connect to the 'cursor-changed' signal and automatically 
put the cell the cursor went to into editing mode with 
gtk_tree_view_set_cursor() etc.?

Yes, I did this some time ago in C. I usually program in Python via
PyGTK and there is some bug in the binding that make the same code not
work. But anyway, It is possible in C.

You could write your own cell renderer that derives from GtkCellRendererText, 
and copy'n'paste the 2-3 functions of GtkCellRendererText that start/stop the 
editing, and customise those functions to your needs (e.g. connect a key 
press event handler to the entry widget etc.). 

Yes, that seems a possible solution

Maybe this isn't even necessary, and you could just connect a 
'key-press-event' handler to the main window or tree view, in which case you 
would get the key press events before the entry widget does, and could pass 
on the events or not as you please, and take the appropriate action (e..g 
move down one cell, etc.).

I just try this idea connecting a key-press-event handler to the tree
view but when the entry has the focus the tree view doesn't get this
event.

Just some ideas, I have no idea if they work :)

Thanks a lot, they have made me think in some different directions :)

Anyway, I'll attach my C code just in case anyone wants to play with it.


Cheers
-Tim

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Attachment: editable-treeview.c
Description: Text Data



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