Struct druid_shell::WindowBuilder
source · pub struct WindowBuilder(_);
Expand description
A builder type for creating new windows.
Implementations§
source§impl WindowBuilder
impl WindowBuilder
sourcepub fn new(app: Application) -> WindowBuilder
pub fn new(app: Application) -> WindowBuilder
Create a new WindowBuilder
.
Takes the Application
that this window is for.
sourcepub fn set_handler(&mut self, handler: Box<dyn WinHandler>)
pub fn set_handler(&mut self, handler: Box<dyn WinHandler>)
Set the WinHandler
for this window.
This is the object that will receive callbacks from this window.
sourcepub fn set_size(&mut self, size: Size)
pub fn set_size(&mut self, size: Size)
Set the window’s initial drawing area size in display points.
The actual window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the size of the window. The
platform might choose a different size depending on its DPI or other platform-dependent
configuration. To know the actual size of the window you should handle the
WinHandler::size
method.
sourcepub fn set_min_size(&mut self, size: Size)
pub fn set_min_size(&mut self, size: Size)
Set the window’s minimum drawing area size in display points.
The actual minimum window size in pixels will depend on the platform DPI settings.
This should be considered a request to the platform to set the minimum size of the window. The platform might increase the size a tiny bit due to DPI.
sourcepub fn show_titlebar(&mut self, show_titlebar: bool)
pub fn show_titlebar(&mut self, show_titlebar: bool)
Set whether the window should have a titlebar and decorations.
sourcepub fn set_transparent(&mut self, transparent: bool)
pub fn set_transparent(&mut self, transparent: bool)
Set whether the window background should be transparent
sourcepub fn set_position(&mut self, position: Point)
pub fn set_position(&mut self, position: Point)
Sets the initial window position in display points. For windows with a parent, the position is relative to the parent. For windows without a parent, it is relative to the origin of the virtual screen. See also set_level
sourcepub fn set_level(&mut self, level: WindowLevel)
pub fn set_level(&mut self, level: WindowLevel)
Sets the initial WindowLevel
.
Set the window’s menu.
sourcepub fn set_window_state(&mut self, state: WindowState)
pub fn set_window_state(&mut self, state: WindowState)
Sets the initial state of the window.
sourcepub fn build(self) -> Result<WindowHandle, Error>
pub fn build(self) -> Result<WindowHandle, Error>
Attempt to construct the platform window.
If this fails, your application should exit.