pub struct FrameController { /* private fields */ }Expand description
A UI-thread controller for one Slint window.
The controller intentionally is not Send or Sync: Slint windows and
Win32 subclass operations belong to the UI thread. Cloning it is cheap.
Implementations§
Source§impl FrameController
impl FrameController
Sourcepub fn attach<C: ComponentHandle + 'static>(
component: &C,
options: FrameOptions,
) -> Result<Self, FrameError>
pub fn attach<C: ComponentHandle + 'static>( component: &C, options: FrameOptions, ) -> Result<Self, FrameError>
Attach automatically during Slint’s first RenderingSetup callback.
This is the one-line API for normal applications. It occupies Slint’s
rendering notifier for this window; use Self::attach_window if the
application already owns that notifier.
Sourcepub fn attach_window(
window: &Window,
options: FrameOptions,
) -> Result<Self, FrameError>
pub fn attach_window( window: &Window, options: FrameOptions, ) -> Result<Self, FrameError>
Attach immediately to an already-created Slint window.
Call this from the application’s own RenderingSetup notifier when it
needs to keep using that notifier for custom rendering.
Sourcepub fn on_event(&self, handler: impl Fn(FrameEvent) + 'static)
pub fn on_event(&self, handler: impl Fn(FrameEvent) + 'static)
Receive hover/install/detach events. Replaces the previous handler.
Sourcepub fn clear_event_handler(&self)
pub fn clear_event_handler(&self)
Remove the event handler.
Sourcepub fn set_client_areas(&self, areas: impl Into<Vec<ClientArea>>)
pub fn set_client_areas(&self, areas: impl Into<Vec<ClientArea>>)
Replace interactive Slint areas in the title bar.
Sourcepub fn caption_hover(&self) -> Option<CaptionButton>
pub fn caption_hover(&self) -> Option<CaptionButton>
Current caption-button hover state.
Sourcepub fn is_attached(&self) -> bool
pub fn is_attached(&self) -> bool
Whether the Win32 frame is currently installed.
Sourcepub fn last_error(&self) -> Option<FrameError>
pub fn last_error(&self) -> Option<FrameError>
Most recent asynchronous installation error, if any.
Sourcepub fn detach(&self) -> Result<(), FrameError>
pub fn detach(&self) -> Result<(), FrameError>
Restore the normal Windows non-client frame and remove the subclass.