Re: Cross-coupling comboboxes



On 08/06/2019 12:44, Daniel Boles via gtkmm-list wrote:
> There may be a better fix. It would be nice if calling clear() on the
> model didn't invoke the signal_changed of BOTH comboboxes 328 times each

Blocking the signal is another way to do it. That may or may not have any quantitative difference in speed (from sigc not having to call your handler), but it might well lead to nicer handler code if you don't have to check for all the abnormal conditions, by simply blocking so it's never called in such cases instead.
Yes, that sounds like a possibility. AFAICT the "blocking" has to be applied per-signal, so I need to keep track of all the connection instances for all the comboboxes, yes?

Another idea I have is to unset the model from the ComboBoxes before clearing the model, then reassociate it with them afterwards. That might result in only notify::model being emitted, rather than all the ::changed.

That also sounds promising. I had wondered about something similar (making the new model separately, then swapping to it, before deleting the old one) but if there's no issue with the comboboxes being "disconnected" for the duration of the update then your version would be easier.

Thanks.



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