Package libavg :: Module avg :: Class Node

Class Node




Base class for all elements in the avg tree.

Instance Methods
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
getParent()
Returns the container (AVGNode or DivNode) the node is in.
 
getRelPos(abspos)
Transforms a position in window coordinates to an position
 
releaseEventCapture(cursorid)
Restores normal mouse operation after a call to setEventCapture().
 
setEventCapture(cursorid)
Sets up event capturing so that cursor events are sent to this node regardless of the cursor position.
 
setEventHandler(type, source, pyfunc)
Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties
  active
If this attribute is true, the node behaves as usual.
  height
  id
A unique identifier that can be used to reference the node.
  opacity
A measure of the node's transparency.
  sensitive
A node only reacts to events if sensitive is true.
  width
  x
The position of the node's left edge relative to it's parent node.
  y
The position of the node's top edge relative to it's parent node.

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 
Raises an exception This class cannot be instantiated from Python
Overrides: object.__init__

getParent()

 
Returns the container (AVGNode or DivNode) the node is in. For the root node, returns None.
Returns:
node

getRelPos(abspos)

 
Transforms a position in window coordinates to an position
Parameters:
  • abspos - Absolute coordinate to transform.
Returns:
relpos

releaseEventCapture(cursorid)

 
Restores normal mouse operation after a call to setEventCapture().
Parameters:
  • cursorid - The id of the tracker cursor to release (optional).

setEventCapture(cursorid)

 
Sets up event capturing so that cursor events are sent to this node regardless of the cursor position. cursorid is optional; if left out, the mouse cursor is captured. If not, events from a specific tracker cursor are captured. If the node doesn't handle the event, it propagates to its parent normally. This function is useful for the implementation of user interface elements such as scroll bars. Only one node can capture a cursor at any one time. Normal operation can be restored by calling releaseEventCapture().
Parameters:
  • cursorid - The id of the tracker cursor to capture (optional).

setEventHandler(type, source, pyfunc)

 
Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs. This function is similar to the event handler node attributes (e.g. oncursordown). It is more specific since it takes the event source as a parameter and allows the use of any python callable as callback function.
Parameters:
  • type - One of the event types KEYUP, KEYDOWN, CURSORMOTION, CURSORUP, CURSORDOWN, CURSOROVER, CURSOROUT, RESIZE or QUIT.
  • source - MOUSE for mouse events, TOUCH for multitouch touch events, TRACK for multitouch track events or other tracking.
  • pyfunc - The python callable to invoke.

Property Details

active

If this attribute is true, the node behaves as usual. If not, it is neither drawn nor does it react to events. Videos are paused.
Get Method:
unreachable(...)
Set Method:
unreachable(...)

height

Get Method:
unreachable(...)
Set Method:
unreachable(...)

id

A unique identifier that can be used to reference the node.
Get Method:
unreachable(...)
Set Method:
unreachable(...)

opacity

A measure of the node's transparency. 0.0 is completely transparent, 1.0 is completely opaque. Opacity is relative to the parent node's opacity.
Get Method:
unreachable(...)
Set Method:
unreachable(...)

sensitive

A node only reacts to events if sensitive is true.
Get Method:
unreachable(...)
Set Method:
unreachable(...)

width

Get Method:
unreachable(...)
Set Method:
unreachable(...)

x

The position of the node's left edge relative to it's parent node.
Get Method:
unreachable(...)
Set Method:
unreachable(...)

y

The position of the node's top edge relative to it's parent node.
Get Method:
unreachable(...)
Set Method:
unreachable(...)