[][src]Struct div::div_handle::DivHandle

pub struct DivHandle(_);

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

impl DivHandle[src]

pub fn hide(&self) -> Result<(), DivError>[src]

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.

pub fn show(&self) -> Result<(), DivError>[src]

Displays a div again after it has been hidden by calling hide

pub fn reposition(&self, x: u32, y: u32) -> Result<(), DivError>[src]

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.

pub fn resize(&self, w: u32, h: u32) -> Result<(), DivError>[src]

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.

pub fn reposition_and_resize(
    &self,
    x: u32,
    y: u32,
    w: u32,
    h: u32
) -> Result<(), DivError>
[src]

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.

pub fn set_css(&self, property: &str, value: &str) -> Result<(), DivError>[src]

Set CSS property of div

pub fn add_class(&self, css_class: &str) -> Result<(), DivError>[src]

Add a CSS class to the div

pub fn remove_class(&self, css_class: &str) -> Result<(), DivError>[src]

Remove a CSS class to the div

pub fn delete(&mut self) -> Result<(), DivError>[src]

Removes a div from the DOM and deletes it

pub fn parent_element(&self) -> Result<HtmlElement, DivError>[src]

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.

pub fn first_inner_node(&self) -> Result<Node, DivError>[src]

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.

Trait Implementations

impl Clone for DivHandle[src]

impl Copy for DivHandle[src]

impl Debug for DivHandle[src]

impl Eq for DivHandle[src]

impl Hash for DivHandle[src]

impl PartialEq<DivHandle> for DivHandle[src]

impl StructuralEq for DivHandle[src]

impl StructuralPartialEq for DivHandle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.