Close#
func (window *Window) Close()Close requests that the native window close. Closing the final window ends RunApplication after all platform resources have been released.
API 文档由 Go 源码生成,内容为英文。
type Window struct {
// minimized mirrors what the platform last reported through OnMinimize.
// maximized mirrors what the platform last reported through OnMaximize.
}Window is one independently retained native window. Close is idempotent and may be called from a window callback or another goroutine; the platform adapter performs the actual close on its native event-loop thread.
Close#func (window *Window) Close()Close requests that the native window close. Closing the final window ends RunApplication after all platform resources have been released.
Closed#func (window *Window) Closed() boolClosed reports whether the platform has finished closing the window.
Frame#func (window *Window) Frame() (ui.Rect, bool)Frame returns the window's content area in screen coordinates: logical pixels from the top-left corner of the primary display, y down, the coordinates ui.PointerEvent.ScreenX and ScreenY use. A drag that ends over another of the application's windows finds it by comparing its pointer with their frames. The result is false for a closed window. On displays of different scale the coordinates of windows on different displays are only approximately comparable. It may be called from any goroutine.
Hidden#func (window *Window) Hidden() boolHidden reports whether Hide took the window off the screen and Show has not put it back. A macOS Dock reopen also goes through Show.
Hide#func (window *Window) Hide()Hide takes the window off the screen without closing it. Its content, state and GPU resources stay, and the application keeps running while it is the only window, which is how an application stays in the status area after the user closes its main window. Hiding a hidden or closed window does nothing.
Maximized#func (window *Window) Maximized() boolMaximized reports whether the window manager has the window maximized. It follows the state the platform last reported to OnMaximize on Windows and Linux, so it changes while the window is hidden too. On platforms without a maximization state (such as macOS), it reports false. It may be called from any goroutine.
Minimized#func (window *Window) Minimized() boolMinimized reports whether the window manager has the window minimized: in the Dock, the taskbar, or the desktop's icon area. It follows the state the platform last reported to OnMinimize, so it changes while the window is hidden too. It may be called from any goroutine.
Show#func (window *Window) Show()Show puts the window back on the screen in front of the others and brings the application forward. Showing a window already on screen raises it.