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.
Members
TYPEto_refcreate_native_control_coredestroy_native_control_coreconstructnewnative_control_handlenative_control_handle_changedtry_update_native_control_position
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<NativeControlHost>
Returns a strong reference to this object.
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.
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.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a native control host.
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).
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeControlImplExtNativeControlHostImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<NativeControlHost>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplStyledElementImplLayoutableImplInteractiveImplInputElementImplVisualImplNativeControlHostImplControlImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.