Package library :: Package pyjamas :: Package ui :: Module Widget :: Class Widget
[hide private]
[frames] | no frames]

Class Widget

source code

   object --+        
            |        
      Applier --+    
                |    
UIObject.UIObject --+
                    |
                   Widget

Base class for most of the UI classes. This class provides basic services used by any Widget, including management of parents and adding/removing the event handler association with the DOM.

Instance Methods [hide private]
 
__init__(self, **kwargs)
use this to apply properties as a dictionary, e.g.:
source code
 
getLayoutData(self) source code
 
getParent(self)
Widgets are kept in a hierarchy, and widgets that have been added to a panel will have a parent widget that contains them.
source code
 
isAttached(self)
Return whether or not this widget has been attached to the document.
source code
 
setContextMenu(self, menu) source code
 
onBrowserEvent(self, event) source code
 
onLoad(self) source code
 
doDetachChildren(self) source code
 
doAttachChildren(self) source code
 
onAttach(self)
Called when this widget has an element, and that element is on the document's DOM tree, and we have a parent widget.
source code
 
onDetach(self)
Called when this widget is being removed from the DOM tree of the document.
source code
 
setLayoutData(self, layoutData) source code
 
setParent(self, parent)
Update the parent attribute.
source code
 
removeFromParent(self)
Remove ourself from our parent.
source code
 
getID(self)
Get the id attribute of the associated DOM element.
source code
 
setID(self, id)
Set the id attribute of the associated DOM element.
source code

Inherited from UIObject.UIObject: addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getClientHeight, getClientWidth, getElement, getHeight, getOffsetHeight, getOffsetWidth, getStyleAttribute, getStyleName, getStylePrimaryName, getTitle, getVisible, getWidth, isVisible, removeStyleDependentName, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleAttribute, setStyleName, setTitle, setVisible, setWidth, setzIndex, sinkEvents, unsinkEvents

Inherited from Applier: applyValues, retrieveValues, setDefaults, setElementProperties, updateInstance

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

Class Methods [hide private]

Inherited from UIObject.UIObject (private): _getProps

Inherited from Applier (private): _getElementProps

Class Variables [hide private]

Inherited from UIObject.UIObject (private): _props

Inherited from Applier (private): _elem_props

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 

use this to apply properties as a dictionary, e.g.:

   x = klass(..., StyleName='class-name')

will do:

   x = klass(...)
   x.setStyleName('class-name')

and:

   x = klass(..., Size=("100%", "20px"), Visible=False)

will do:

   x = klass(...)
   x.setSize("100%", "20px")
   x.setVisible(False)
Overrides: object.__init__
(inherited documentation)

getParent(self)

source code 

Widgets are kept in a hierarchy, and widgets that have been added to a panel will have a parent widget that contains them. This retrieves the containing widget for this widget.

setParent(self, parent)

source code 

Update the parent attribute. If the parent is currently attached to the DOM this assumes we are being attached also and calls onAttach().

removeFromParent(self)

source code 

Remove ourself from our parent. The parent widget will call setParent(None) on us automatically