Change components properties in large scale
<p>I have a reasonable amount of components attached to a window. I want to change some properties of these components when a button is pressed.
But do this in one component at a time is a boring job and will involve many lines of code.
It is possible to make a component to listen the other component signal to perform a task when the signal is released?
That is, something like the observer pattern.
If this is not possible. What would be the best way to do a mass change of these components?</p>

<p>Example:</p>

<p><a href="http://i.stack.imgur.com/mKkp3.png" rel="nofollow"><img src="http://i.stack.imgur.com/mKkp3.png" alt="enter image description here"></a></p>

<p><a href="https://paste.gnome.org/psstffmkw" rel="nofollow">Code UI</a></p>

<p>And if I want to reset all the other components to the initial state when the "Reset" button is triggered?
Create a handler to the button signal and change the components (Entries, Switches, CheckBose, ...) one at a time is very tiring</p>

<p>This may not be the answer you wanted but...</p>

<p>You are probably optimizing in the wrong place. The window in your example takes about 6 lines of very straight-forward code to 'reset'. This is insignificant compared to the benefits of the solution:</p>

<ul>
<li>the code is very easy to understand later on</li>
<li>it's also easy to modify later on (when e.g. a default value changes)</li>
</ul>

<p>These are far more important things than the two minutes you spend on writing the code originally -- and this is unlikely to change even if you make the form more complex (although I would question the basic design if you end up with a screen full of GtkEntries).</p>

python gtk gtk3