Struct div::div_handle::DivHandle
source · pub struct DivHandle(_);
Expand description
A light-weight key to refer to the state necessary to manipulate a div.
This is a unique identifier that will become invalid once the div has been deleted.
Implementations§
source§impl DivHandle
impl DivHandle
sourcepub fn hide(&self) -> Result<(), DivError>
pub fn hide(&self) -> Result<(), DivError>
Hides the div and all child nodes.
The div node is removed from the DOM but it is kept in memory.
Call delete
to give up memory or call show
later to display pane again.
sourcepub fn show(&self) -> Result<(), DivError>
pub fn show(&self) -> Result<(), DivError>
Displays a div again after it has been hidden by calling hide
sourcepub fn reposition(&self, x: i32, y: i32) -> Result<(), DivError>
pub fn reposition(&self, x: i32, y: i32) -> Result<(), DivError>
Adjust the relative position of the div.
The provided parameters are taken in the original scale when initializing, taking any calls to the global div::resize() into consideration.
sourcepub fn resize(&self, w: u32, h: u32) -> Result<(), DivError>
pub fn resize(&self, w: u32, h: u32) -> Result<(), DivError>
Adjust the size of the div.
The provided parameters are taken in the original scale when initializing, taking any calls to the global div::resize() into consideration.
sourcepub fn reposition_and_resize(
&self,
x: i32,
y: i32,
w: u32,
h: u32
) -> Result<(), DivError>
pub fn reposition_and_resize( &self, x: i32, y: i32, w: u32, h: u32 ) -> Result<(), DivError>
Adjust the position and size of the div in a single call, which is slightly more efficient than calling resize and reposition separately.
The provided parameters are taken in the original scale when initializing, taking any calls to the global div::resize() into consideration.
sourcepub fn set_css(&self, property: &str, value: &str) -> Result<(), DivError>
pub fn set_css(&self, property: &str, value: &str) -> Result<(), DivError>
Set CSS property of div
sourcepub fn remove_class(&self, css_class: &str) -> Result<(), DivError>
pub fn remove_class(&self, css_class: &str) -> Result<(), DivError>
Remove a CSS class to the div
sourcepub fn parent_element(&self) -> Result<HtmlElement, DivError>
pub fn parent_element(&self) -> Result<HtmlElement, DivError>
Get a reference to the DOM element associated with the div. The provided HTML when creating a new div will be the child node(s) of the returned element.
sourcepub fn first_inner_node(&self) -> Result<Node, DivError>
pub fn first_inner_node(&self) -> Result<Node, DivError>
Get a reference to the DOM node created by the provided HTML when creating the pane. If multiple nodes have been created, the first node is returned.