Package libavg :: Module textarea

Module textarea

source code

Classes
  FocusContext
This object serves as a grouping element for TextAreas.
  TextArea
TextArea is an extended <words> node that reacts to user input (mouse/touch for focus, keyboard for text input).
Functions
 
init(g_avg, catchKeyboard=True, repeatDelay=0.2, charDelay=0.1)
This method should be called immediately after avg file load (Player.loadFile())
source code
 
onFrame() source code
 
onKeyDown(e) source code
 
onKeyUp(e) source code
 
setActiveFocusContext(focusContext) source code
 
setActivityCallback(pyfunc)
If a callback of user interaction is needed (eg: resetting idle timeout) just pass a function to this method, which is going to be called at each user intervention (keydown, keyup).
source code
Variables
  CURSOR_FLASHING_DELAY = 1000
  CURSOR_FLASH_AFTER_INACTIVITY = 200
  CURSOR_PADDING_PCT = 15
  CURSOR_SPACING_PCT = 4
  CURSOR_WIDTH_PCT = 4
  DEFAULT_CURSOR_PX = 'tacursorpx.png'
  KEYCODES_BACKSPACE = (8, 127)
  KEYCODE_FORMFEED = 12
  KEYCODE_SHTAB = 25
  KEYCODE_TAB = 9
  g_CharDelay = 0.1
  g_FocusContext = None
  g_LastKeyEvent = None
  g_LastKeyRepeated = 0
  g_Player = None
  g_RepeatDelay = 0.2
  g_activityCallback = None
Function Details

init(g_avg, catchKeyboard=True, repeatDelay=0.2, charDelay=0.1)

source code 
This method should be called immediately after avg file load (Player.loadFile())
Parameters:
  • g_avg - avg package
  • catchKeyboard - boolean, if true events from keyboard are catched

setActiveFocusContext(focusContext)

source code 
Parameters:
  • focusContext - sets the active focusContext. If initialization has been made with 'catchKeyboard' == True, the new active focusContext will receive the flow of events from keyboard.

setActivityCallback(pyfunc)

source code 
If a callback of user interaction is needed (eg: resetting idle timeout) just pass a function to this method, which is going to be called at each user intervention (keydown, keyup). Active focusContext will be passed as argument