Module: Teek::UI
- Defined in:
- lib/teek/ui.rb,
lib/teek/ui/var.rb,
lib/teek/ui/node.rb,
lib/teek/ui/image.rb,
lib/teek/ui/scope.rb,
lib/teek/ui/errors.rb,
lib/teek/ui/handle.rb,
lib/teek/ui/keysyms.rb,
lib/teek/ui/screens.rb,
lib/teek/ui/session.rb,
lib/teek/ui/version.rb,
lib/teek/ui/document.rb,
lib/teek/ui/realizer.rb,
lib/teek/ui/event_bus.rb,
lib/teek/ui/validator.rb,
lib/teek/ui/widget_dsl.rb,
lib/teek/ui/canvas_item.rb,
lib/teek/ui/modal_stack.rb,
lib/teek/ui/widget_type.rb,
lib/teek/ui/menu_builder.rb,
lib/teek/ui/mouse_events.rb,
lib/teek/ui/text_content.rb,
lib/teek/ui/widget_types.rb,
lib/teek/ui/event_binding.rb,
lib/teek/ui/realized_node.rb,
lib/teek/ui/tab_validator.rb,
lib/teek/ui/grid_validator.rb,
lib/teek/ui/pane_validator.rb,
lib/teek/ui/tree_inspector.rb,
lib/teek/ui/overlay_anchors.rb,
lib/teek/ui/component_handle.rb,
lib/teek/ui/widget_types/tab.rb,
lib/teek/ui/overlay_validator.rb,
lib/teek/ui/widget_addressing.rb,
lib/teek/ui/widget_types/pane.rb,
lib/teek/ui/widget_validators.rb,
lib/teek/ui/option_dump_parsing.rb,
lib/teek/ui/widget_types/window.rb,
lib/teek/ui/menu_entry_addressing.rb
Overview
A DSL for building teek (Tk) apps - sugar over teek, not a wall around it. Everything here compiles down to plain teek calls, and every handle keeps an escape hatch back to the underlying App.
Defined Under Namespace
Modules: GridValidator, Keysyms, MouseEvents, OptionDumpParsing, OverlayAnchors, OverlayValidator, PaneRealize, PaneValidator, TabRealize, TabValidator, WidgetDSL, WindowRealize Classes: CanvasItem, ClosedBuilderError, ComponentHandle, Document, EventBinding, EventBus, Handle, Image, MenuBuilder, MenuEntryAddressing, ModalStack, Node, NotRealizedError, RealizedNode, Realizer, Scope, Screens, Session, TextContent, TreeInspector, ValidationError, Validator, Var, WidgetAddressing, WidgetType, WidgetTypes, WidgetValidators
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.auto_scroll ⇒ Boolean
Whether a bare list/text_area/table/tree auto-attaches a scrollbar with no
ui.scrollablewrapper needed - true by default. -
.auto_scroll_canvas ⇒ Boolean
The same default, but for canvas specifically - false by default, since a canvas is as often fixed drawing as scrollable content, unlike the other native types.
Class Method Summary collapse
Class Attribute Details
.auto_scroll ⇒ Boolean
Returns whether a bare list/text_area/table/tree
auto-attaches a scrollbar with no ui.scrollable wrapper needed -
true by default. Three levels can override it, most specific
wins: a widget's own scroll: option, then Teek::UI.app's own
scroll:, then this global default.
20 21 22 |
# File 'lib/teek/ui.rb', line 20 def auto_scroll @auto_scroll end |
.auto_scroll_canvas ⇒ Boolean
Returns the same default, but for canvas specifically - false by default, since a canvas is as often fixed drawing as scrollable content, unlike the other native types.
25 26 27 |
# File 'lib/teek/ui.rb', line 25 def auto_scroll_canvas @auto_scroll_canvas end |
Class Method Details
.app(title: nil, scroll: nil, **app_opts) {|ui| ... } ⇒ Session
Build an app. Constructs a Session (Tk-free - no App exists
yet), yields it to the block, and returns that same session so
.run/.run_async can be chained directly off the call. The
underlying app is created lazily, at realize (see Teek::UI::Session#realize).
48 49 50 51 52 |
# File 'lib/teek/ui.rb', line 48 def self.app(title: nil, scroll: nil, **app_opts, &block) session = Session.new(title: title, scroll: scroll, app_opts: app_opts) block.call(session) if block session end |