Module p.u.r.shiftpaned

Part of pida.utils.rat

No module docstring
Line # Kind Name Docs
13 Function _state_to_operation Undocumented
20 Function _get_operations 0 how get operation works is really simple, there are two booleans packed in
83 Function _get_operations Undocumented
88 Class ShiftPaned A ShiftPaned is a gtk.Paned that can hide one of its child widgets,
222 Class SidebarPaned Undocumented
270 Function on_click 0 Undocumented
276 Function on_click Undocumented
def _state_to_operation(old_state, new_state):
Undocumented
def _get_operations 0(old_state, new_state):
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.
 
def _get_operations(old_state, new_state):
Undocumented
def on_click 0(btn):
Undocumented
def on_click(btn):
Undocumented
API Documentation for PIDA, generated by pydoctor.