Package fife :: Package extensions :: Package pychan :: Package widgets' :: Module containers :: Class Container
[hide private]
[frames] | no frames]

Class Container

source code

   object --+    
            |    
widget.Widget --+
                |
               Container

This is the basic container class. It provides space in which child widgets can be position via the position attribute. If you want to use the layout engine, you have to use derived containers with vertical or horizontal orientation (VBox or HBox)

New Attributes

Instance Methods [hide private]
 
__init__(self, parent=None, name=None, size=None, min_size=None, max_size=None, helptext=None, position=None, style=None, hexpand=None, vexpand=None, font=None, base_color=None, background_color=None, foreground_color=None, selection_color=None, border_size=None, position_technique=None, is_focusable=None, comment=None, padding=None, background_image=None, opaque=None, margins=None, _real_widget=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
addChild(self, widget)
This function adds a widget as child widget and is only implemented in container widgets.
source code
 
insertChild(self, widget, position)
This function inserts a widget a given index in the child list.
source code
 
insertChildBefore(self, widget, before)
Inserts a child widget before a given widget.
source code
 
removeChild(self, widget)
This function removes a direct child widget and is only implemented in container widgets.
source code
 
hideChild(self, child) source code
 
showChild(self, child) source code
 
add(self, *widgets) source code
 
getMaxChildrenWidth(self) source code
 
getMaxChildrenHeight(self) source code
 
deepApply(self, visitorFunc, leaves_first=True)
Recursively apply a callable to all contained widgets and then the widget itself.
source code
 
beforeShow(self)
This method is called just before the widget is shown.
source code
 
_resetTiling(self) source code
 
setBackgroundImage(self, image) source code
 
getBackgroundImage(self) source code
 
_setOpaque(self, opaque) source code
 
_getOpaque(self) source code

Inherited from widget.Widget: __repr__, __str__, adaptLayout, addChildren, afterHide, capture, collectData, collectDataAsDict, distributeData, distributeInitialData, execute, expandContent, findChild, findChildByName, findChildren, getAbsolutePos, getData, getNamedChildren, hide, isCaptured, isVisible, listNamedWidgets, mapEvents, match, removeAllChildren, removeChildren, requestFocus, resizeToContent, setData, setInitialData, show, sizeChanged, stylize

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

Class Variables [hide private]
  ATTRIBUTES = Widget.ATTRIBUTES+ [IntAttr('padding'), Attr('bac...
  DEFAULT_OPAQUE = True
  DEFAULT_MARGINS = 5, 5
  DEFAULT_PADDING = 5
  DEFAULT_BACKGROUND = None
hash(x)
  background_image = property(getBackgroundImage, setBackgroundI...
  opaque = property(_getOpaque, _setOpaque)

Inherited from widget.Widget: DEFAULT_BORDER_SIZE, DEFAULT_COMMENT, DEFAULT_FONT, DEFAULT_HELPTEXT, DEFAULT_HEXPAND, DEFAULT_MAX_SIZE, DEFAULT_MIN_SIZE, DEFAULT_NAME, DEFAULT_POSITION, DEFAULT_POSITION_TECHNIQUE, DEFAULT_SIZE, DEFAULT_VEXPAND, HIDE_SHOW_ERROR, background_color, base_color, border_size, font, foreground_color, height, is_focusable, max_height, max_width, min_height, min_width, name, parent, position, selection_color, size, style, width, x, y

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent=None, name=None, size=None, min_size=None, max_size=None, helptext=None, position=None, style=None, hexpand=None, vexpand=None, font=None, base_color=None, background_color=None, foreground_color=None, selection_color=None, border_size=None, position_technique=None, is_focusable=None, comment=None, padding=None, background_image=None, opaque=None, margins=None, _real_widget=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

addChild(self, widget)

source code 

This function adds a widget as child widget and is only implemented in container widgets.

You'll need to call adaptLayout if the container is already shown, to adapt the layout to the new widget. This doesn't happen automatically.

Overrides: widget.Widget.addChild
(inherited documentation)

insertChild(self, widget, position)

source code 

This function inserts a widget a given index in the child list.

See addChild and insertChildBefore

Overrides: widget.Widget.insertChild
(inherited documentation)

insertChildBefore(self, widget, before)

source code 

Inserts a child widget before a given widget. If the widget isn't found, the widget is appended to the children list.

See addChild and insertChild

Overrides: widget.Widget.insertChildBefore
(inherited documentation)

removeChild(self, widget)

source code 

This function removes a direct child widget and is only implemented in container widgets.

You'll need to call adaptLayout if the container is already shown, to adapt the layout to the removed widget. This doesn't happen automatically.

Overrides: widget.Widget.removeChild
(inherited documentation)

deepApply(self, visitorFunc, leaves_first=True)

source code 

Recursively apply a callable to all contained widgets and then the widget itself.

Overrides: widget.Widget.deepApply
(inherited documentation)

beforeShow(self)

source code 

This method is called just before the widget is shown. You can override this in derived widgets to add finalization behaviour.

NOTE:

  • if your widget is a container, you have to call _resetTiling(), as you will loose this call by using your override method
Overrides: widget.Widget.beforeShow
(inherited documentation)

Class Variable Details [hide private]

ATTRIBUTES

Value:
Widget.ATTRIBUTES+ [IntAttr('padding'), Attr('background_image'), Bool\
Attr('opaque'), PointAttr('margins')]

background_image

Value:
property(getBackgroundImage, setBackgroundImage)