Package libavg :: Module avg :: Class DivNode

Class DivNode


A div node is a node that groups other nodes logically and visually. Its upper left corner is used as point of origin for the coordinates of its child nodes. Its extents are used to clip the children. Its opacity is used as base opacity for the child nodes' opacities. The children of a div node are drawn in the order they are found in the avg file.

Instance Methods
 
appendChild(node)
Adds a new child to the container behind the last existing child.
node
getChild(pos)
Returns the child at position pos.
numchildren
getNumChildren()
Returns the number of immediate children that this div contains.
 
indexOf(childnode)
Returns the index of the child given or -1 if childnode isn't a child of the container.
 
insertChild(node, pos)
Adds a new child to the container at position pos.
 
insertChildBefore(newNode, oldChild)
Adds a new child to the container in front of the existing node oldChild.
 
removeChild(node)
Removes the child given by pNode.
 
reorderChild(oldPos, newPos)
Moves the child at index pos so it's at index newPos.

Inherited from unreachable.instance: __new__

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

    Inherited from AreaNode
AreaNode
getElementByPos(pos)
Returns the topmost child node that is at the position given.
mediasize
getMediaSize()
Returns the size in pixels of the media in the node.
    Inherited from Node
 
__eq__(...)
 
__hash__(...)
hash(x)
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
__ne__(...)
abspos
getAbsPos(relpos)
Transforms a position in coordinates relative to the node to a position in window coordinates.
node
getParent()
Returns the container (AVGNode or DivNode) the node is in.
relpos
getRelPos(abspos)
Transforms a position in window coordinates to a position in coordinates relative to the node.
 
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.
None
unlink(kill)
Removes a node from it's parent container.
Properties
  crop
Turns clipping on or off.
  elementoutlinecolor
Allows debugging of div node nesting by rendering the outlines of this div and all its div children in the specified color.
  mediadir
The directory that the media files for the children of this node are in.

Inherited from object: __class__

    Inherited from AreaNode
  angle
The angle that the node is rotated to in radians.
  height
  pivot
The position of the point that the node is rotated around.
  pivotx
Deprecated.
  pivoty
Deprecated.
  pos
The position of the node's top left corner relative to it's parent node.
  size
  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 Node
  active
If this attribute is true, the node behaves as usual.
  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.
Method Details

indexOf(childnode)

 

Returns the index of the child given or -1 if childnode isn't a child of the container. This function does a linear search through the list of children until the child is found.

removeChild(node)

 

Removes the child given by pNode.

removeChild(pos) Removes the child at index pos.

reorderChild(oldPos, newPos)

 

Moves the child at index pos so it's at index newPos. This function can be used to change the order in which the children are drawn.

reorderChild(node, newPos) Moves the child node so it's at index newPos. This function can be used to change the order in which the children are drawn.


Property Details

crop

Turns clipping on or off. Default is True.

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

elementoutlinecolor

Allows debugging of div node nesting by rendering the outlines of this div and all its div children in the specified color. Turn off by setting the color to "".

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

mediadir

The directory that the media files for the children of this node are in.

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