Window

In the Makepad framework, Window Widgets are the fundamental components used to create and manage application windows. As a top-level container, it is responsible for hosting other widgets of the application interface and provides a series of configuration options, allowing developers to customize the behavior and appearance of windows. By using Window Widgets, developers can define properties such as window size, title, and background color to create a window interface that meets application requirements.

在Makepad框架中,Window Widget 是用于创建和管理应用程序窗口的基础组件。它作为顶层容器,负责承载应用界面的其它Widgets,并且提供了一系列的配置选项,允许开发者定制窗口的行为和外观。通过使用 Window Widget,开发者能够定义窗口的大小、标题、背景颜色等属性,从而创建出符合应用需求的窗口界面。

Props

decorate 修饰nametypedescription
livelast_mouse_posDVec2存储了最后一次鼠标位置
livemouse_cursor_sizeDVec2存储鼠标光标的大小
livedemobool指示是否处于演示模式
rustdemo_next_frameNextFrame控制演示模式下的下一帧渲染
livecursor_draw_listDrawList2d定义在窗口中绘制光标时所需的绘制指令列表
livedraw_cursorDrawQuad绘制光标的矩形区域
livedebug_viewDebugView显示调试信息
liveperformance_viewPerformanceView性能指标
livenav_controlNavControl用于处理导航相关的控制逻辑
livewindowWindowHandle代表窗口的句柄或引用
livestdin_sizeDrawColor
rustoverlayOverlay用于在窗口上层显示额外的内容或界面元素
rustmain_draw_listDrawList2d存储主要内容的绘制指令
livepassPass用于描述渲染过程中的一个阶段或步骤
rustdepth_textureTexture存储深度纹理,这在3D渲染或需要深度测试的场景中非常重要
livehide_caption_on_fullscreenbool控制全屏时是否隐藏标题栏
liveshow_performance_viewbool控制全屏时是否显示性能视图
derefviewView表示Window内部包含一个View结构体,用于处理窗口内部的视图渲染和布局
rustdraw_stateDrawStateWrap<DrawState>

View props are deref. See: View

Event

namedescription
EventForOtherWindow用于另一个窗口的事件。这用于在窗口之间传递事件。
An event intended for another window. This is used to pass events between windows.
WindowClosed表示窗口已关闭。当用户关闭窗口时会触发此事件。
Indicates that the window has been closed. This event is triggered when the user closes the window.
WindowGeomChange窗口几何图形(大小、位置等)的更改。此事件通过“WindowGeomChangeEvent”携带有关几何图形更改的数据。
A change in the window's geometry (size, position, etc.). This event carries data about the geometry change through a WindowGeomChangeEvent.