class
Tessell::Widgets::VirtualList
- Tessell::Widgets::VirtualList
- Reference
- Object
Defined in:
tessell/widgets/virtual_list.crConstructors
Instance Method Summary
-
#acquired_total : Int32
recycle stats
-
#bind_visible(&block : Int32, Int32 -> Nil) : Int32
Bind only visible rows.
- #created_total : Int32
-
#dirty_rects(max_regions : Int32 = 8) : NamedTuple(count: Int32, area: Int64)
Dirty rects from accumulated scroll since last call.
- #each_visible(&block : Int32, Int32 -> Nil) : Int32
- #fetched_count : Int32
- #invalidate_heights : Nil
- #invalidate_row(i : Int32) : Nil
- #node_offset(i : Int32) : Int32
- #pool_size : Int32
-
#prepare_visible : Int32
Reconcile recycler accounting for current visible range and fetch visible rows.
- #recycle_stats : NamedTuple(acquired: Int32, released: Int32, reused: Int32, created: Int32, pool_size: Int32)
- #released_total : Int32
-
#resize_viewport(width : Int32, height : Int32) : Nil
视口尺寸变化:更新可见窗口与回收池估算,不重建行数据。
- #reused_total : Int32
- #row_count : Int32
- #scroll_by(dy : Int32) : Int32
- #scroll_to(y : Int32) : Int32
- #scroll_y : Int32
- #total_height : Int32
- #viewport_h : Int32
- #viewport_w : Int32
- #visible_first : Int32
- #visible_last : Int32
- #visible_range : NamedTuple(first: Int32, last: Int32)
Constructor Detail
Instance Method Detail
Bind only visible rows. Calls fetch(index) for each visible row and yields (index, offset). Tracks recycler acquire/release/reused/created by diffing visible ranges.
Dirty rects from accumulated scroll since last call. < viewport_h => up to 2 strips (old exposed + new exposed); >= viewport_h => 1 full window. Returns {count, area}. Uses Dirty.merge_into into reusable sink.
Reconcile recycler accounting for current visible range and fetch visible rows. No block/yield: hot-path friendly (avoids closure/Proc capture in caller). Returns fetched_count. Use visible_first/visible_last + node_offset(i) to iterate work.