Trait IListBoxItemGenerator2D
pub trait IListBoxItemGenerator2D: AsAny {
// Required methods
fn attach(&self, node: Weak<Node2D>) -> Result<(), Error>;
fn detach(&self, node: Weak<Node2D>) -> Result<(), Error>;
fn acquire_item(&self, index: usize) -> Result<Weak<Node2D>, Error>;
fn release_item(&self, node: Option<Weak<Node2D>>) -> Result<(), Error>;
fn get_item_index(
&self,
node: Option<Weak<Node2D>>,
) -> Result<Option<usize>, Error>;
fn get_item_size(&self, index: usize) -> Result<Vector2, Error>;
fn get_count(&self) -> Result<usize, Error>;
}Required Methods§
fn acquire_item(&self, index: usize) -> Result<Weak<Node2D>, Error>
fn acquire_item(&self, index: usize) -> Result<Weak<Node2D>, Error>
Gets the object to display at the given index. If the object already exists and was not freed, the method returns the object from cache.
fn release_item(&self, node: Option<Weak<Node2D>>) -> Result<(), Error>
fn release_item(&self, node: Option<Weak<Node2D>>) -> Result<(), Error>
Frees the object returned by getObject
fn get_item_index(
&self,
node: Option<Weak<Node2D>>,
) -> Result<Option<usize>, Error>
fn get_item_index( &self, node: Option<Weak<Node2D>>, ) -> Result<Option<usize>, Error>
Gets the index of the object returned by getObject.
fn get_item_size(&self, index: usize) -> Result<Vector2, Error>
fn get_item_size(&self, index: usize) -> Result<Vector2, Error>
Gets the size of the object to display at the given index. If you do not provide an object prototype to the list box, Kanzi uses the size that this method returns. If it is not possible to determine the item size without acquiring the item first, returns an unbounded layout value. It is recommended to cache the sizes of objects.