pub struct Panel { /* private fields */ }Expand description
A panel. It is Copy: the overlay keeps it until the process ends.
Implementations§
Source§impl Panel
impl Panel
Sourcepub fn as_raw(&self) -> *mut AnvilPanel
pub fn as_raw(&self) -> *mut AnvilPanel
The raw panel, for the C table.
Sourcepub fn set_rows(&self, rows: &[Row<'_>]) -> Result<()>
pub fn set_rows(&self, rows: &[Row<'_>]) -> Result<()>
Replaces the rows: at most 1024, each text at most 4096 bytes, else
InvalidArgument. A NUL inside a text is dropped.
Sourcepub fn on_click(
&self,
handler: impl Fn(u64) + Send + Sync + 'static,
) -> Result<()>
pub fn on_click( &self, handler: impl Fn(u64) + Send + Sync + 'static, ) -> Result<()>
The handler of the panel’s buttons (it gets the button’s id), replacing the last one. Clicks run on the game’s main thread; without anvil-game no click is delivered.
Trait Implementations§
impl Copy for Panel
impl Send for Panel
impl Sync for Panel
Auto Trait Implementations§
impl Forget for Panel
impl Freeze for Panel
impl Move for Panel
impl RefUnwindSafe for Panel
impl Unpin for Panel
impl UnsafeUnpin for Panel
impl UnwindSafe for Panel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more