Window Creation and Control
Windows are created by WindowOption, returning the current window's WindowId after successful creation.
WindowOption handles window's initial configuration:
Default values:
continuous_rendering only controls whether event loop continuously triggers redraw, doesn't change Flor's interface model. Regular GUI applications keep default value; animation, real-time preview, game loop etc. scenarios needing per-frame refresh set to true.
open's View Function
open signature is:
view_fn is the window root view's build function. After Flor creates platform window, renderer and window entry, it passes current window's WindowId to it, and converts return value to window root view tree.
If you don't need to use window ID, write it as _window_id.
How to Use WindowId in open Parameter
It is not recommended to directly call window control methods using the window_id in open(move |window_id| { ... }) during the root view build phase. At this time the window is completing initialization, Flor is still mounting the root view, registering the renderer, initializing focus and refreshing layout; directly calling set_size, set_window_mode, request_redraw, destroy etc. in this closure easily makes the initialization order unexpected, producing extra redraw, layout state inconsistency or platform layer behavior issues.
This WindowId is more suitable for being captured into view events, used to control current window in subsequent events:
If just setting initial title, size, background color, refresh mode, should prioritize writing in WindowOption fields, not changing in open's closure.
WindowId
WindowId is platform window's handle wrapper. In current Windows platform implementation it's:
It implements WindowApi and WindowOperations. Need to import trait when calling these methods:
Creation and Lifecycle
Display and Window Mode
WindowMode includes Normal, Minimized, Maximized, Fullscreen. In current Windows implementation, Fullscreen is temporarily treated as maximized.
Position and Size
Position uses i32, allowing negative coordinates in multi-monitor environments; size uses u32.
DPI, IME and Mouse
Redraw
Regular view state changes are automatically requested for redraw by Flor. Only when you directly change external state through window or platform capabilities that framework can't detect, you need to manually call request_redraw().

