pub struct ListClipperToken<'ui> { /* private fields */ }Expand description
List clipper is a mechanism to efficiently implement scrolling of large lists with random access.
For example you have a list of 1 million buttons, and the list clipper will help you only draw the ones which are visible.
Implementations§
Source§impl<'ui> ListClipperToken<'ui>
impl<'ui> ListClipperToken<'ui>
Sourcepub fn step(&mut self) -> bool
pub fn step(&mut self) -> bool
Progress the list clipper.
If this returns returns true then the you can loop between
between clipper.display_start() .. clipper.display_end().
If this returns false, you must stop calling this method.
Calling step again after it returns false will cause imgui
to abort. This mirrors the C++ interface.
It is recommended to use the iterator interface!
Sourcepub fn end(&mut self)
pub fn end(&mut self)
This is automatically called back the final call to
step. You can call it sooner but typically not needed.
Sourcepub fn display_start(&self) -> i32
pub fn display_start(&self) -> i32
First item to call, updated each call to step
Sourcepub fn display_end(&self) -> i32
pub fn display_end(&self) -> i32
End of items to call (exclusive), updated each call to step
Sourcepub fn iter(self) -> ListClipperIterator<'ui> ⓘ
pub fn iter(self) -> ListClipperIterator<'ui> ⓘ
Get an iterator which outputs all visible indexes. This is the recommended way of using the clipper.