FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    NativeControlHost

    struct · ferroui-controls · v0.5.0

    struct NativeControlHost
    

    Hosts a native control of the platform inside the visual tree: the native control is created for the top-level the host is attached to and follows the bounds and the visibility of the host.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<NativeControlHost>
    

    Returns a strong reference to this object.

    Source

    create_native_control_core

    fn create_native_control_core(self: &Self, parent: Rc<dyn IPlatformHandle>) -> Rc<dyn IPlatformHandle>
    

    Creates the native control as a child of parent. The default asks the native control host of the platform for its default child.

    Source

    destroy_native_control_core

    fn destroy_native_control_core(self: &Self, control: Rc<dyn IPlatformHandle>)
    

    Destroys the native control. The default destroys a handle that can be destroyed.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a native control host.

    Source

    native_control_handle

    fn native_control_handle(self: &Self) -> Option<Rc<dyn IPlatformHandle>>
    

    The handle of the native control, once it has been created (internal upstream).

    Source

    native_control_handle_changed

    fn native_control_handle_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Raised when the handle of the native control changes (internal upstream).

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the host.

    Source

    try_update_native_control_position

    fn try_update_native_control_position(self: &Self) -> bool
    

    Moves the native control to the bounds of the host, or hides it when the host is not visible. Returns false when there is no native control host or the host has no size yet.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.