Package ocempgui :: Package widgets :: Module Frame :: Class Frame
[show private | hide private]
[frames | no frames]

Type Frame

 object --+                
          |                
INotifyable --+            
              |            
     BaseObject --+        
                  |        
     object --+   |        
              |   |        
         Sprite --+        
                  |        
         BaseWidget --+    
                      |    
              Container --+
                          |
                         Frame

Known Subclasses:
HFrame, VFrame

Frame (widget=None) -> Frame

A container widget class with decorative border.

The Frame widget is a container widget, which can draw a decorative border around its children and supports a title widget, which will be displayed in the topleft corner of the frame. It also supports alignment of its children.

The 'align' attribute and set_align() method allow enable the frame to align its children. Dependant on the alignment type (see also ALIGN_TYPES) and the concrete Frame implementation, the children will be placed differently within the frame.

frame.align = ALIGN_TOP frame.set_align (ALIGN_TOP)

The border to draw around the children can be influenced using the 'border' attribute or set_border() method. The default is to draw a sunken border.

frame.border = BORDER_ETCHED_IN frame.set_border (BORDER_ETCHED_IN)

The 'widget' attribute contains the widget, which will be placed in the topleft corner of the frame. It is suitable as title widget and has no limitations about the type of the widget. It should be noted that the widget can be removed by assinging None or passing None to the set_title_widget() method. The old title widget of the Frame will be destroyed, if you reassign the property.

frame.widget = Label ('Title') frame.set_title_widget (Label ('Title'))

Default action (invoked by activate()): None

Mnemonic action (invoked by activate_mnemonic()): None

Attributes: align - Alignment of the children. border - The border style to set for the frame. widget - Widget to put in the topleft corner of the frame.
Method Summary
  __init__(self, widget)
  destroy(self)
F.destroy () -> None
  set_align(self, align)
F.set_align (...) -> None
  set_border(self, border)
F.set_border (...) -> None
  set_focus(self, focus)
F.set_focus (focus=True) -> None
  set_title_widget(self, widget)
F.set_title_widget (...) -> None
    Inherited from Container
  add_child(self, *children)
C.add_child (...) -> None
  calculate_size(self)
C.calculate_size (...) -> int, int
  dispose_widgets(self)
C.dispose_widgets (...) -> None
  insert_child(self, pos, *children)
C.insert_child (...) -> None
  remove_child(self, child)
C.remove_child (...) -> None
  set_children(self, children)
C.set_children (...) -> None
  set_depth(self, depth)
C.set_depth (...) -> None
  set_event_manager(self, manager)
C.set_event_manager (...) -> None
  set_indexable(self, indexable)
C.set_indexable (...) -> None
  set_padding(self, padding)
C.set_padding (...) -> None
  set_sensitive(self, sensitive)
C.set_sensitive (...) -> None
  set_spacing(self, spacing)
C.set_spacing (...) -> None
  update(self, **kwargs)
C.update (...) -> None
    Inherited from BaseWidget
  activate(self)
W.activate () -> None
  activate_mnemonic(self, mnemonic)
W.activate_mnemonic (...) -> bool
  check_sizes(self, width, height)
W.check_sizes (...) -> int, int
  create_style(self)
W.create_style () -> WidgetStyle
  debug_update(self)
For debugging usage only
  draw(self)
W.draw () -> None
  draw_bg(self)
W.draw_bg () -> Surface
  get_style(self)
W.get_style () -> WidgetStyle
  initclass(cls)
B.initclass () -> None (Class method)
  lock(self)
W.lock () -> None
  notify(self, event)
W.notify (...) -> None
  rect_to_client(self, rect)
W.rect_to_client (...) -> pygame.Rect
  set_dirty(self, dirty, update)
W.set_dirty (...) -> None
  set_entered(self, entered)
W.set_entered (...) -> None
  set_event_area(self, area)
W.set_event_area (...) -> None
  set_index(self, index)
W.set_index (...) -> None
  set_maximum_size(self, width, height)
W.set_maximum_size (...) -> None
  set_minimum_size(self, width, height)
W.set_minimum_size (...) -> None
  set_opacity(self, opacity)
W.set_opacity (...) -> None
  set_position(self, x, y)
W.set_position (...) -> None
  set_size(self, width, height)
W.set_size (...) -> None
  set_state(self, state)
W.set_state (...) -> None
  set_style(self, style)
W.set_style (...) -> None
  set_tooltip(self, tooltip)
W.set_tooltip (...) -> None
  unlock(self)
W.unlock () -> None
    Inherited from BaseObject
  connect_signal(self, signal, callback, *data)
B.connect_signal (...) -> EventCallback
  disconnect_signal(self, event)
B.disconnect_signal (...) -> None
  emit(self, signal, data)
B.emit (...) -> bool
  run_signal_handlers(self, signal, *data)
B.run_signal_handlers (...) -> None
    Inherited from Sprite
  __repr__(self)
  add(self, *groups)
add(group or list of of groups, ...) add a sprite to container
  add_internal(self, group)
  alive(self)
alive() -> bool check to see if the sprite is in any groups
  groups(self)
groups() -> list of groups list used sprite containers
  kill(self)
kill() remove this sprite from all groups
  remove(self, *groups)
remove(group or list of groups, ...) remove a sprite from container
  remove_internal(self, group)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
  align: The alignment to use for the children.
  border: The border style to set for the Frame.
  widget: The title widget to set for the Frame.
    Inherited from Container
  children: List of the children for the Container.
  padding: The additional padding for the Container.
  spacing: The spacing between the children.
    Inherited from BaseWidget
  bottom
  bottomleft
  bottomright
  center
  centerx
  centery
  controls: Widgets associated with the widget.
  depth: The z-axis layer depth of the widget.
  dirty: Indicates, whether the widget need to be redrawn.
  entered: Indicates, whether the widget is entered.
  eventarea: The area, which gets the events.
  focus: The focus of the widget.
  h
  height
  image: The visible surface of the widget.
  index: The tab index position of the widget.
  indexable: The IIndexable, the widget is attached to.
  left
  locked: Indicates, whether the widget is locked.
  maxsize: The maximum size to occupy by the widget.
  midbottom
  midleft
  midright
  midtop
  minsize: The guaranteed size of the widget.
  opacity: The opacity of the widget.
  position: The position of the topleft corner.
  rect: The area occupied by the widget.
  right
  sensitive: The sensitivity of the widget.
  size
  state: The current state of the widget.
  style: The style of the widget.
  tooltip: The tool tip text to display for the widget.
  top
  topleft
  topright
  w
  width
  x
  y
    Inherited from BaseObject
  manager: The event manager to use by the object.

Instance Method Details

destroy(self)

F.destroy () -> None

Destroys the Frame and removes it from its event system.
Overrides:
ocempgui.widgets.Container.Container.destroy

set_align(self, align)

F.set_align (...) -> None

Sets the alignment for the widgets.

Raises a TypeError, if the passed argument is not a value from ALIGN_TYPES.

set_border(self, border)

F.set_border (...) -> None

Sets the border type to be used by the Frame.

Raises a ValueError, if the passed argument is not a value from BORDER_TYPES

set_focus(self, focus=True)

F.set_focus (focus=True) -> None

Overrides the set_focus() behaviour for the Frame.

The Frame class is not focusable by default. It is a layout class for other widgets, so it does not need to get the input focus and thus it will return false without doing anything.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.set_focus

set_title_widget(self, widget)

F.set_title_widget (...) -> None

Sets the widget to display in the topleft corner.

Raises a TypeError, if the passed argument does not inherit from the BaseWidget class.

Property Details

align

The alignment to use for the children.
Get Method:
unknown-696665676(...)
Set Method:
unknown-696665732(...)

border

The border style to set for the Frame.
Get Method:
unknown-696665788(...)
Set Method:
unknown-696665844(...)

widget

The title widget to set for the Frame.
Get Method:
unknown-696665900(...)
Set Method:
unknown-696665956(...)

Generated by Epydoc 2.1 on Thu Jan 10 10:18:44 2008 http://epydoc.sf.net