Skip to main content

NativeView

Function NativeView 

Source
pub fn NativeView(handle: NativeHandle) -> NativeViewScope
Expand description

A place in the window for a platform view the application made: a web view, a video surface or a map, as an NSView, an HWND or an X11 window.

Make the view against the handle the window reported (compose_rust::native_view::native_parent), then hand it over here. The Renderer puts it over this node’s rectangle and keeps it there as the layout moves and scrolls, cuts it to what the node’s ancestors and any menu, popover or dialog drawn above it leave showing, and hands keyboard focus to it and back. It never destroys the view: once the node is gone, or NativeHandle::NONE has replaced the handle, and the batch saying so has been applied, the view is the application’s to destroy.

The node has no size of its own. Give it one with its modifier (a size, a fill, a weight); what the modifier draws shows only where the view does not cover it.