Package tipy :: Module clbk :: Class Callback
[hide private]
[frames] | no frames]

Class Callback

source code

object --+
         |
        Callback

Allow access to the current buffers from anywhere.

This class is used as a callback to retrieve and modify the input buffers. There is two input buffers the left buffer and the right buffer:

It is possible to subclass this class and override its methods in order to use the program in other GUIs or command line interfaces.

Class Hierarchy for Callback
Class Hierarchy for Callback

Instance Methods [hide private]
 
__init__(self)
Initialize the left and right buffer to empty string.
source code
 
update(self, character, offset=0)
Update the left and right buffers.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initialize the left and right buffer to empty string.

Overrides: object.__init__

update(self, character, offset=0)

source code 

Update the left and right buffers.

This method should be called after each character addition or deletion or after each cursor move. In the default GUI this method is called when a signal indicating that the input text have changed or that the cursor position have changed.

Parameters:
  • character (str) - The character which has been inputted. It could be any character associated to keyboard keys including backspace, arrow keys...
  • offset (int) - Indicate the cursor position offset against the previous cursor position. 0 means no move, a positive value means move to the right and a negative value means move to the left.