Make CellLayout clever about translating iterators to child models.
Make CellLayout clever about translating iterators to child models.

This patch is a hack around a bug in Gtk+ that is at least present in EntryCompletion. Often the CellLayout interface is only half-heartedly implementedin the widgets. For instance the EntryCompletion widget takes a model with the completion and wraps a TreeModelFilter around it which is used to only admit selected entries into the drop down list. Although EntryCompletion implements the CellLayout interface, all the gtk_cell_layout_set_cell_data_func does is to forward any queryies to the contained model that the user has set. What it should do is to translate from the filter model to the user model. In order to work around this bug, this patch adds the functionality to cellLayoutSetAttributeFunc that checks if the model in the call back is the same as the model that was given as an argument. If not, the model in the callback is checked to be a TreeModelFilter or a TreeModelSort and the iterator is then automatically translated. This patch therefore also makes it possible to define how the values of cell renderers should be set even if the view that contains the cell renderers accesses them using a TreeModelFilter or a TreeModelSort.



gtk2hs/gtksourceview,gtk2hs/gtksourceview