Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
Widget System

A GUI Widget is the main element that Graphical User Interfaces (GUI) made with Rapicorn are composed of.

Widget States
  • ANCHORED
    The toplevel parent (root) of an anchored widget is a Rapicorn.Window. The Rapicorn.WidgetImpl.hierarchy_changed() method is called whenever the ANCHORED state of a widget changes.
  • VISIBLE
    A widget is visible if its VISIBLE flag is set.
    Use: A widget must be visible to actively participate in size requisition and size allocation. In order to grab focus and process key events, the widget and all its parents must be visible, see Rapicorn.WidgetImpl.key_sensitive().
  • VIEWABLE
    A widget is viewable if it's visible, its UNVIEWABLE flag is unset and its parent is viewable.
    Use: Children may be temporarily taken offscreen in which case they are flagged UNVIEWABLE. Examples are offscreen children of a list, inactive notebook pages or an inactive popup.
  • DRAWABLE
    A widget is drawable if it's viewable and its clipped_allocation has non-zero size. A widget must be drawable to participate in pointer event handling and rendering, see Rapicorn.WidgetImpl.pointer_sensitive().
Focus Handling
A Rapicorn.Window allows a specific widget to receive keyboard events at any given time, this is the "focus widget". Keyboard shortcuts like Tab, Shift-Tab, Up, Down, Left, Right (sometimes in combination with Control) allow moving the focus from one widget to another.
  1. The Rapicorn.WidgetImpl.move_focus() method generally implements movement of the current focus widget along the list of focusable widgets in a window.
  2. Rapicorn.Container generally keep track of the last child that had focus (the focus_child) or was part of the focus chain (an ancestor of the widget having focus).
  3. Onece focus moves on, the Container.focus_child is adjusted or unset. Some containers need to memorize the last focus child, the Container.focus_lost() method can be overridden for this purpose.
  4. The Window.auto_focus property controls whether a window contains an initially focused widget when it is shown.
  5. The FOCUS_CHAIN flag is used to keep track of the current focus widget and its ancestry.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines