Module: Teek::UI::OverlayAnchors Private

Defined in:
lib/teek/ui/overlay_anchors.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

ui.overlay's at: vocabulary - corners, center, and the four edge midpoints, spelled in plain English rather than Tk's own compass anchors (nw/n/ne/w/center/e/sw/s/se) - the same litmus test every other DSL name follows (decoding one should never need Tk knowledge). Each maps to place's own -relx/-rely/-anchor, needed both to validate at: (WidgetDSL#overlay) and to actually place the widget (Realizer#place_overlay) - one shared table so the two can never drift out of sync with each other.

Constant Summary collapse

POSITIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  top_left: { relx: 0.0, rely: 0.0, anchor: 'nw' },
  top: { relx: 0.5, rely: 0.0, anchor: 'n' },
  top_right: { relx: 1.0, rely: 0.0, anchor: 'ne' },
  left: { relx: 0.0, rely: 0.5, anchor: 'w' },
  center: { relx: 0.5, rely: 0.5, anchor: 'center' },
  right: { relx: 1.0, rely: 0.5, anchor: 'e' },
  bottom_left: { relx: 0.0, rely: 1.0, anchor: 'sw' },
  bottom: { relx: 0.5, rely: 1.0, anchor: 's' },
  bottom_right: { relx: 1.0, rely: 1.0, anchor: 'se' },
}.freeze