Re: Multiple questions on the treeview



Jef Driesen wrote:
I have create a window with a treeview to show some data to the user (read-only) and some other widgets to edit the selected item. See my website [1] for a screenshot.

[1] http://users.telenet.be/sacn/tmp/treeview.png

Now I have a few problems/question:

1. Correctly updating the treeview model?

I connect to the 'changed' signal of the treeview selection, to make the other widgets show the contents of the selected row. For the comboboxes, I connect to the 'changed' signal to update the treeview model. But for the text entries, I connect to the 'focus_out_event' to update the model (and reformat the text entry itself).

This works great, except when the focus goes from a text entry to the treeview. In that case, the 'changed' event of the treeview is fired *before* the 'focus_out_event' of the text entry. This means the treeview model does not get updated correctly and the change is lost. How can I change that?

I did some testing, and noticed that the selection 'changed' signal is emitted *before* the 'focus_in_event' of the treeview. In my case, this means that when one of the text entries has the focus, and I use the mouse to select another row in the treeview, signals are emitted in this order:

on_treeview_selection_changed
on_entry_focus_out_event
on_treeview_focus_in_event

I think the 'on_treeview_selection_changed' should be fired as the last one. Is this a bug in gtk/gtkmm?




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