How to copy or duplicate gtk widgets?
In my application I have one huge GtkComboBox created with one long for loop which eats up so much of time and I am using this combo at two places in one single screen.
So, what I want to do is create this combo for one time and duplicate/copy it in another one so it will save my time.
If I try to add same combo box pointer two times, gtk gives me error “child->paren != NULL” cause in gtk widget can have only single parent.
So what to do?
This is why many widgets in GTK+ that show data are based on models. The model holds the data, not the widget. A widget acts as a “view” into the data, and models can be shared between several widgets.
You just need to use the same model in both combo boxes: