| moveTo(x: number, y: number): Promise\<void> | Moves the window position. A positive value of **x** indicates that the window moves to the right, and a positive value of **y** indicates that the window moves downwards.|
Currently, the main window is automatically created when the application is started. The declaration period, hiding, and destruction of the main window are managed by the application.
### Creating a Subwindow
You can call **create** to create a subwindow. The sample code is as follows:
在当前模型下,应用启动时会自动创建主窗口,由应用管理窗口的声明周期,隐藏及销毁由应用管理。
### 创建子窗口
当前可以通过`create`接口创建子窗口。具体示例代码如下:
```
import window from '@ohos.window';
...
...
@@ -37,9 +37,9 @@ You can call **create** to create a subwindow. The sample code is as follows:
});
```
### Obtaining a Window Object
### 获取窗口对象
-Call **getTopWindow** to obtain the top window of the application. The sample code is as follows:
-应用内可以通过`getTopWindow`来获取当前应用内最后显示的窗口。具体示例代码如下:
```
var windowClass = null;
...
...
@@ -52,7 +52,7 @@ You can call **create** to create a subwindow. The sample code is as follows:
})
```
-You can also call **find** to obtain created subwindows in the application. The sample code is as follows:
-应用内也可以通过`Find`来获取已经创建的子窗口。具体示例代码如下:
```
var windowClass = null;
...
...
@@ -65,9 +65,9 @@ You can call **create** to create a subwindow. The sample code is as follows:
});
```
### Hiding and Destroying a Window
### 窗口的隐藏和销毁
After a window object is obtained, you can call **hide** and **destroy** to hide and destroy the window object, respectively. The sample code is as follows:
The Window Manager subsystem provides basic capabilities of window and display management. It is the basis for UI display.
The Window Manager subsystem enables multiple applications to use the same physical screen for display and interaction. For each application, you need to design the interaction interface in the fixed window area. A window acts as a display container of the application interface, and the Window Manager subsystem organizes the interaction interfaces into a form visible to end users.
** Immersive**: The colors of the application interface, status bar, and navigation bar are the same to achieve the visual integrity.
**沉浸式**:应用窗口跟状态栏与导航栏颜色一致,视觉上融合。
## Working Principles
## 运作机制
To display a UI on a screen, the application and system need to request a window object from the Window Manager subsystem. This object generally represents a rectangular area on the screen and has attributes such as the position, width, height, and overlay layer. The object also loads the root node of the UI framework in the interface. The UI of the application is loaded and displayed in the window through the root node.