class
Opal::UI::ScreenStack
- Opal::UI::ScreenStack
- Reference
- Object
Overview
Screen stack orchestrator inspired by Python Textual's Screen Stack. Manages navigation flow, modal dialog layering, backdrop dimming, and dismissal callbacks.
Defined in:
opal/asciicast.cropal/ui/screen_stack.cr
Constructors
Instance Method Summary
-
#active_screen : Screen | Nil
Returns the currently focused top-of-stack screen
- #empty? : Bool
- #handle_key(event : Terminal::KeyEvent) : Bool
- #handle_mouse(event : Terminal::MouseEvent) : Bool
-
#pop_screen : Screen | Nil
Pops and unmounts the active screen
-
#push_screen(screen : Screen, &callback : ModalResult -> Nil) : Screen
Pushes a new screen onto the stack with optional dismissal callback
-
#push_screen(screen : Screen) : Screen
Pushes a screen without a dismissal block
- #record_cast(output_path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", &block : Asciicast::ScreenRecorder -> Nil) : Nil
-
#render(buffer : Buffer, x : Int32 = 0, y : Int32 = 0, width : Int32 = buffer.width, height : Int32 = buffer.height) : Nil
Renders the screen stack with automatic modal backdrop compositing
- #size : Int32
- #stack : Array(Screen)
-
#switch_screen(screen : Screen) : Screen
Replaces entire stack or top screen with a new screen
Constructor Detail
Instance Method Detail
Pushes a new screen onto the stack with optional dismissal callback
def record_cast(output_path : String, width : Int32 = 80, height : Int32 = 24, title : String = "Opal Session", &block : Asciicast::ScreenRecorder -> Nil) : Nil
#
def render(buffer : Buffer, x : Int32 = 0, y : Int32 = 0, width : Int32 = buffer.width, height : Int32 = buffer.height) : Nil
#
Renders the screen stack with automatic modal backdrop compositing
Replaces entire stack or top screen with a new screen