struct
Termisu::Event::Resize
- Termisu::Event::Resize
- Struct
- Value
- Object
Overview
Terminal resize event.
Generated when the terminal window size changes (SIGWINCH). Optionally includes previous dimensions for incremental resize handling.
Example:
event = termisu.poll_event
if event.is_a?(Termisu::Event::Resize)
puts "Terminal resized to #{event.width}x#{event.height}"
if event.changed?
puts "Changed from #{event.old_width}x#{event.old_height}"
end
termisu.sync # Force full redraw
end
Defined in:
termisu/event/resize.crConstructors
Instance Method Summary
-
#changed? : Bool
Returns true if the dimensions have changed from previous values.
-
#height : Int32
New terminal height in rows.
-
#old_height : Int32 | Nil
Previous terminal height in rows (nil if unknown or first resize).
-
#old_width : Int32 | Nil
Previous terminal width in columns (nil if unknown or first resize).
-
#width : Int32
New terminal width in columns.
Constructor Detail
def self.new(width : Int32, height : Int32, old_width : Int32 | Nil = nil, old_height : Int32 | Nil = nil)
#
Instance Method Detail
def changed? : Bool
#
Returns true if the dimensions have changed from previous values.
Returns true if:
- Previous dimensions are unknown (nil)
- Width or height differs from previous values