how get operation works is really simple, there are two booleans packed in
an integer, namely 'state'.
The first bit is child 1, the second bit is referring to child 2.
So, using the binary notation, the state is like this:
* 00 then it means that child 1 is hidden and so is child 2.
* 01 means that child 1 is visible and child 2 is not.
* 10 means that child 2 is visible and child 1 is not.
Now the shift of states means that some operations will performed, like
'_add_child1' or '_remove_child2', these are mappend to ShiftPaned's
methods.
This means that if I'm changing from SHOW_CHILD1 to SHOW_CHILD2 I will have
to remove child 2 ('_remove_child2') and add child 1 to the pane
('_add_child1'). Lets analize this mathmatically, the latter example means
that we are changing from 01 to 10.
Now for another example, from SHOW_CHILD2 to SHOW_BOTH, the change was from
10 to 11 and we'll have to '_add_child1'.
The conclusion about this is that when we shift from a 0 to a 1 we are
infact adding the child on a given location, if it's the first bit we're
adding child 1 if it's the second bit then we're adding child 2.
But if we shift from a 1 to a 0 then we're removing a child from the pane.
If the numbers are equal we do nothing.
Now the implementation needs two things: the first is to get the visibility
state from each child, these are the 'child1_oper' and 'child2_oper'
lambda functions; the second function is something to convert the bit to
an operation, this is fairly easy, subtracting a bit from the other we'll
have three possible values:
* 1 - 0: positive
* 0 - 1: negative
* 1 - 1 or 0 - 0: equal
If we subtract the new bit from the old bit having a positive number means
that we want to add something and a negative means that we want to remove
it.