pub struct ImageList { /* private fields */ }Expand description
Represents a wxImageList.
This struct is a wrapper around the wxWidgets ImageList object. It provides owned and unowned variants - owned instances are destroyed on Drop, while unowned instances (obtained from controls) are managed by wxWidgets.
Implementations§
Source§impl ImageList
impl ImageList
Sourcepub fn new(width: i32, height: i32, mask: bool, initial_count: i32) -> Self
pub fn new(width: i32, height: i32, mask: bool, initial_count: i32) -> Self
Creates a new, empty image list.
§Arguments
width- The width of images in the list.height- The height of images in the list.mask-trueto use a mask,falseotherwise.initial_count- The initial number of images the list can store (can be resized).
Returns ImageList on success. Panics if creation failed.
Sourcepub fn as_ptr(&self) -> *mut wxd_ImageList_t
pub fn as_ptr(&self) -> *mut wxd_ImageList_t
Returns the raw pointer to the underlying wxImageList object.
This pointer can be used for FFI calls. The caller must ensure the
ImageList object (and thus the pointer) remains valid.
Sourcepub fn add_bitmap(&self, bitmap: &Bitmap) -> i32
pub fn add_bitmap(&self, bitmap: &Bitmap) -> i32
Adds a bitmap to the image list.
The wxImageList makes an internal copy of the bitmap.
§Arguments
bitmap- The bitmap to add.
Returns the index of the added image, or -1 if an error occurred.
Sourcepub fn add_bitmap_with_mask(&self, bitmap: &Bitmap, mask: &Bitmap) -> i32
pub fn add_bitmap_with_mask(&self, bitmap: &Bitmap, mask: &Bitmap) -> i32
Adds a bitmap and its mask to the image list.
The wxImageList makes internal copies of both the bitmap and the mask.
§Arguments
bitmap- The bitmap to add.mask- The mask for the bitmap.
Returns the index of the added image, or -1 if an error occurred.
Sourcepub fn get_image_count(&self) -> i32
pub fn get_image_count(&self) -> i32
Returns the number of images in the list.
Sourcepub fn remove_all(&self) -> bool
pub fn remove_all(&self) -> bool
Removes all images from the list.
Returns true if successful, false otherwise (e.g., if the list pointer is null).