@lynx-js/lynxtron / LynxWindow
LynxWindow
继承
构造函数
new LynxWindow()
LynxWindow
参数
返回
重写了
定义于
属性
autoHideMenuBar Windows
A boolean property that determines whether the window menu bar should hide
itself automatically. Once set, the menu bar will only show when users press the
single Alt key.
If the menu bar is already visible, setting this property to true won't hide
it immediately.
继承自
定义于
apis/api/base-window.d.ts:1626
closable
A boolean property that determines whether the window can be manually closed
by user.
继承自
定义于
apis/api/base-window.d.ts:1633
excludedFromShownWindowsMenu macOS
A boolean property that determines whether the window is excluded from the
application’s Windows menu. false by default.
继承自
BaseWindow.excludedFromShownWindowsMenu
定义于
apis/api/base-window.d.ts:1705
focusable
A boolean property that determines whether the window is focusable.
继承自
定义于
apis/api/base-window.d.ts:1639
fullScreen
A boolean property that determines whether the window is in fullscreen mode.
继承自
定义于
apis/api/base-window.d.ts:1643
fullScreenable
A boolean property that determines whether the maximize/zoom window button
toggles fullscreen mode or maximizes the window.
继承自
定义于
apis/api/base-window.d.ts:1648
id
A Integer property representing the unique ID of the window. Each ID is unique
among all BaseWindow instances of the entire application.
继承自
定义于
apis/api/base-window.d.ts:1711
maximizable
A boolean property that determines whether the window can be manually
maximized by user.
继承自
定义于
apis/api/base-window.d.ts:1655
minimizable
A boolean property that determines whether the window can be manually
minimized by user.
继承自
定义于
apis/api/base-window.d.ts:1662
movable
A boolean property that determines Whether the window can be moved by user.
继承自
定义于
apis/api/base-window.d.ts:1668
resizable
A boolean property that determines whether the window can be manually resized
by user.
继承自
定义于
apis/api/base-window.d.ts:1673
shadow
A boolean property that determines whether the window has a shadow.
继承自
定义于
apis/api/base-window.d.ts:1677
simpleFullScreen
A boolean property that determines whether the window is in simple (pre-Lion)
fullscreen mode.
继承自
定义于
apis/api/base-window.d.ts:1682
tabbingIdentifier
定义于
title
A string property that determines the title of the native window.
Application content may present a different title from the native window title.
继承自
定义于
apis/api/base-window.d.ts:1689
visibleOnAllWorkspaces macOS
A boolean property that determines whether the window is visible on all
workspaces.
Always returns false on Windows.
继承自
BaseWindow.visibleOnAllWorkspaces
定义于
apis/api/base-window.d.ts:1698
方法
addListener()
event: "app-command" Windows
参数
返回
this
继承自
定义于
event: "blur"
参数
返回
this
继承自
定义于
event: "close"
参数
返回
this
继承自
定义于
event: "closed"
参数
返回
this
继承自
定义于
event: "will-enter-full-screen"
参数
返回
this
继承自
定义于
event: "enter-full-screen"
参数
返回
this
继承自
定义于
event: "focus"
参数
返回
this
继承自
定义于
event: "hide"
参数
返回
this
继承自
定义于
event: "will-leave-full-screen"
参数
返回
this
继承自
定义于
event: "leave-full-screen"
参数
返回
this
继承自
定义于
event: "maximize"
参数
返回
this
继承自
定义于
event: "minimize"
参数
返回
this
继承自
定义于
event: "move"
参数
返回
this
继承自
定义于
event: "moved"
参数
返回
this
继承自
定义于
event: "resize"
参数
返回
this
继承自
定义于
event: "resized"
参数
返回
this
继承自
定义于
event: "restore"
参数
返回
this
继承自
定义于
event: "always-on-top-changed"
参数
返回
this
继承自
定义于
event: "rotate-gesture" macOS
参数
返回
this
继承自
定义于
event: "session-end" Windows
参数
返回
this
继承自
定义于
event: "sheet-begin" macOS
参数
返回
this
继承自
定义于
event: "sheet-end" macOS
参数
返回
this
继承自
定义于
event: "new-window-for-tab" macOS
参数
返回
this
继承自
定义于
event: "show"
参数
返回
this
继承自
定义于
event: "swipe" macOS
参数
返回
this
继承自
定义于
event: "system-context-menu" Windows
参数
返回
this
继承自
定义于
event: "unmaximize"
参数
返回
this
继承自
定义于
event: "will-move"
参数
返回
this
继承自
定义于
event: "will-resize"
参数
返回
this
继承自
定义于
addTabbedWindow() macOS
Adds window as a tab on this window, after the tab for the current window.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1142
blur()
Removes focus from the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1002
center()
Moves window to the center of the screen.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1006
close()
Try to close the window. This has the same effect as a user manually clicking
the close button of the window. The close may be canceled by a listener on the
close event.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1012
destroy()
Force closing the window. The close event will not be emitted for this
window, but it guarantees the closed event will be emitted.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1017
flashFrame()
Starts or stops flashing the window to attract user's attention.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1021
focus()
Focuses on the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1025
fromId()
The window with the given id.
参数
返回
null | LynxWindow
重写了
定义于
getAllWindows()
An array of all opened windows.
返回
重写了
定义于
getBackgroundColor()
Gets the background color of the window in Hex (#RRGGBB) format.
See Setting backgroundColor.
The alpha value is not returned alongside the red, green, and blue values.
返回
string
继承自
定义于
apis/api/base-window.d.ts:1038
getBounds()
The bounds of the window as Object.
On macOS, the returned y-coordinate will be at minimum the menu bar
height. For example, calling win.setBounds({ x: 25, y: 20, width: 800, height: 600 \}) with a menu bar height of 38 means that win.getBounds() will return
{ x: 25, y: 38, width: 800, height: 600 }.
返回
继承自
定义于
apis/api/base-window.d.ts:1047
getChildWindows()
All child windows.
返回
继承自
定义于
apis/api/base-window.d.ts:1051
getContentBounds()
Gets the bounds of the content area.
返回
继承自
定义于
apis/api/base-window.d.ts:1520
getContentSize()
Gets the size of the content area.
返回
number[]
继承自
定义于
apis/api/base-window.d.ts:1512
getFocusedWindow()
The window that is focused in this application, otherwise returns null.
返回
null | LynxWindow
重写了
定义于
getMaximumSize()
Contains the window's maximum width and height.
返回
number[]
继承自
定义于
apis/api/base-window.d.ts:1055
getMinimumSize()
Contains the window's minimum width and height.
返回
number[]
继承自
定义于
apis/api/base-window.d.ts:1059
getNativeWindowHandle()
The platform-specific handle of the window.
The native type of the handle is HWND on Windows, NSView* on macOS.
返回
Buffer
继承自
BaseWindow.getNativeWindowHandle
定义于
apis/api/base-window.d.ts:1065
getNormalBounds()
Contains the window bounds of the normal state
Whatever the current state of the window : maximized, minimized or in
fullscreen, this function always returns the position and size of the window in
normal state. In normal state, getBounds and getNormalBounds returns the same
Rectangle.
返回
继承自
定义于
apis/api/base-window.d.ts:1074
getOpacity()
between 0.0 (fully transparent) and 1.0 (fully opaque).
返回
number
继承自
定义于
apis/api/base-window.d.ts:1078
getParentWindow()
The parent window or null if there is no parent.
返回
null | BaseWindow
继承自
定义于
apis/api/base-window.d.ts:1082
getPosition()
Contains the window's current position.
返回
number[]
继承自
定义于
apis/api/base-window.d.ts:1086
getSize()
getSize()
Contains the window's width and height.
返回
number[]
继承自
定义于
apis/api/base-window.d.ts:1090
getSize()
Contains the window's width and height.
返回
number[]
继承自
定义于
apis/api/base-window.d.ts:1504
getTitle()
The title of the native window.
返回
string
继承自
定义于
apis/api/base-window.d.ts:1094
hasShadow()
Whether the window has a shadow.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1098
hide()
Hides the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1102
hookWindowMessage() Windows
Hooks a windows message. The callback is called when the message is received
in the WndProc.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1109
isAlwaysOnTop()
Whether the window is always on top of other windows.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1116
isClosable()
Whether the window can be manually closed by user.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1122
isDestroyed()
isDestroyed()
Whether the window is destroyed.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1029
isDestroyed()
Whether the window is destroyed.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1126
isEnabled()
whether the window is enabled.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1130
isFocusable()
Whether the window can be focused.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1136
isFocused()
Whether the window is focused.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1146
isFullScreen()
Whether the window is in fullscreen mode.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1150
isFullScreenable()
Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1155
isHiddenInMissionControl()
返回
boolean
继承自
BaseWindow.isHiddenInMissionControl
定义于
apis/api/base-window.d.ts:1156
isMaximizable()
Whether the window can be manually maximized by user.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1162
isMaximized()
Whether the window is maximized.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1166
isMenuBarAutoHide() Windows
Whether menu bar automatically hides itself.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1172
isMenuBarVisible() Windows
Whether the menu bar is visible.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1178
isMinimizable()
Whether the window can be manually minimized by the user.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1184
isMinimized()
Whether the window is minimized.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1188
isModal()
Whether current window is a modal window.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1192
isMovable()
Whether the window can be moved by user.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1198
isNormal()
Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1203
isResizable()
Whether the window can be manually resized by the user.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1207
isSimpleFullScreen() macOS
Whether the window is in simple (pre-Lion) fullscreen mode.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1213
isVisible()
Whether the window is visible to the user in the foreground of the app.
返回
boolean
继承自
定义于
apis/api/base-window.d.ts:1217
isVisibleOnAllWorkspaces() macOS
Whether the window is visible on all workspaces.
This API always returns false on Windows.
返回
boolean
继承自
BaseWindow.isVisibleOnAllWorkspaces
定义于
apis/api/base-window.d.ts:1225
isWindowMessageHooked() Windows
true or false depending on whether the message is hooked.
参数
返回
boolean
继承自
BaseWindow.isWindowMessageHooked
定义于
apis/api/base-window.d.ts:1231
loadBundle()
Load a pre-decoded Lynx template bundle.
Returns true when the request is accepted synchronously. Final load
completion is reported asynchronously via window events such as
ready-to-show and --lynx-error.
参数
返回
boolean
定义于
loadFile()
Starts loading a Lynx bundle from a local file path.
Returns true when the request is accepted synchronously. Final load
completion is reported asynchronously via window events such as
ready-to-show and --lynx-error.
参数
返回
boolean
定义于
loadURL()
Load a Lynx bundle from a URL.
Supported URLs include remote URLs such as https://... and local file
URLs such as file:///abs/path/to/main.lynx.bundle.
Returns true when the request is accepted synchronously. Final load
completion is reported asynchronously via window events such as
ready-to-show and --lynx-error.
参数
返回
boolean
定义于
maximize()
Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1236
mergeAllWindows() macOS
Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1406
minimize()
Minimizes the window. On macOS, the minimized window will be shown in the Dock.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1240
moveTabToNewWindow() macOS
Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1439
moveTop()
Moves window to top(z-order) regardless of focus
返回
void
继承自
定义于
apis/api/base-window.d.ts:1244
off()
event: "app-command" Windows
参数
返回
this
继承自
定义于
event: "blur"
参数
返回
this
继承自
定义于
event: "close"
参数
返回
this
继承自
定义于
event: "closed"
参数
返回
this
继承自
定义于
event: "will-enter-full-screen"
参数
返回
this
继承自
定义于
event: "enter-full-screen"
参数
返回
this
继承自
定义于
event: "focus"
参数
返回
this
继承自
定义于
event: "hide"
参数
返回
this
继承自
定义于
event: "will-leave-full-screen"
参数
返回
this
继承自
定义于
event: "leave-full-screen"
参数
返回
this
继承自
定义于
event: "maximize"
参数
返回
this
继承自
定义于
event: "minimize"
参数
返回
this
继承自
定义于
event: "move"
参数
返回
this
继承自
定义于
event: "moved"
参数
返回
this
继承自
定义于
event: "resize"
参数
返回
this
继承自
定义于
event: "resized"
参数
返回
this
继承自
定义于
event: "restore"
参数
返回
this
继承自
定义于
event: "always-on-top-changed"
参数
返回
this
继承自
定义于
event: "rotate-gesture" macOS
参数
返回
this
继承自
定义于
event: "session-end" Windows
参数
返回
this
继承自
定义于
event: "sheet-begin" macOS
参数
返回
this
继承自
定义于
event: "sheet-end" macOS
参数
返回
this
继承自
定义于
event: "new-window-for-tab" macOS
参数
返回
this
继承自
定义于
event: "show"
参数
返回
this
继承自
定义于
event: "swipe" macOS
参数
返回
this
继承自
定义于
event: "system-context-menu" Windows
参数
返回
this
继承自
定义于
event: "unmaximize"
参数
返回
this
继承自
定义于
event: "will-move"
参数
返回
this
继承自
定义于
event: "will-resize"
参数
返回
this
继承自
定义于
on()
event: "-lynx-invoke" Windows
Emitted when an App Command is invoked. These are typically related to keyboard media keys or browser commands, as well as the "Back" button built into some mice on Windows.
Commands are lowercased, underscores are replaced with hyphens, and the
APPCOMMAND_ prefix is stripped off. e.g. APPCOMMAND_BROWSER_BACKWARD is
emitted as browser-backward.
参数
返回
this
重写了
定义于
event: "-lynx-message"
Emitted when the window loses focus.
参数
返回
this
重写了
定义于
event: "app-command"
Emitted when the window is going to be closed. Calling
event.preventDefault() will cancel the close.
参数
返回
this
重写了
定义于
event: "blur"
Emitted when the window is closed. After you have received this event you should remove the reference to the window and avoid using it any more.
参数
返回
this
重写了
定义于
event: "close"
Emitted before the window enters a full-screen state.
参数
返回
this
重写了
定义于
event: "closed"
Emitted when the window enters a full-screen state.
参数
返回
this
重写了
定义于
event: "will-enter-full-screen"
Emitted when the window gains focus.
参数
返回
this
重写了
定义于
event: "enter-full-screen"
Emitted when the window is hidden.
参数
返回
this
重写了
定义于
event: "focus"
Emitted before the window leaves a full-screen state.
参数
返回
this
重写了
定义于
event: "hide"
Emitted when the window leaves a full-screen state.
参数
返回
this
重写了
定义于
event: "will-leave-full-screen"
Emitted when window is maximized.
参数
返回
this
重写了
定义于
event: "leave-full-screen"
Emitted when the window is minimized.
参数
返回
this
重写了
定义于
event: "maximize"
Emitted when the window is being moved to a new position.
参数
返回
this
重写了
定义于
event: "minimize"
Emitted once when the window is moved to a new position.
On macOS, this event is an alias of move.
参数
返回
this
重写了
定义于
event: "move"
Emitted after the window has been resized.
参数
返回
this
重写了
定义于
event: "moved"
Emitted once when the window has finished being resized.
This is usually emitted when the window has been resized manually. On macOS,
resizing the window with setBounds/setSize and setting the animate
parameter to true will also emit this event once resizing has finished.
参数
返回
this
重写了
定义于
event: "resize"
Emitted when the window is restored from a minimized state.
参数
返回
this
重写了
定义于
event: "resized"
Emitted after the window's always-on-top state changes.
参数
返回
this
重写了
定义于
event: "restore" macOS
Emitted on trackpad rotation gesture. Continually emitted until rotation gesture
is ended. The rotation value on each emission is the angle in degrees rotated
since the last emission. The last emitted event upon a rotation gesture will
always be of value 0. Counter-clockwise rotation values are positive, while
clockwise ones are negative.
参数
返回
this
重写了
定义于
event: "always-on-top-changed" Windows
Emitted when a session is about to end due to a shutdown, machine restart, or user log-off. Once this event fires, there is no way to prevent the session from ending.
参数
返回
this
重写了
定义于
event: "rotate-gesture" macOS
Emitted when the window opens a sheet.
参数
返回
this
重写了
定义于
event: "session-end" macOS
Emitted when the window has closed a sheet.
参数
返回
this
重写了
定义于
event: "sheet-begin" macOS
Emitted when the user clicks the native macOS new tab button. The new tab button
is only visible if the current window has a tabbingIdentifier.
参数
返回
this
重写了
定义于
event: "sheet-end"
Emitted when the window is shown.
参数
返回
this
重写了
定义于
event: "new-window-for-tab" macOS
Emitted on 3-finger swipe. Possible directions are up, right, down,
left.
The method underlying this event is built to handle older macOS-style trackpad
swiping, where the content on the screen doesn't move with the swipe. Most macOS
trackpads are not configured to allow this kind of swiping anymore, so in order
for it to emit properly the 'Swipe between pages' preference in System Preferences > Trackpad > More Gestures must be set to 'Swipe with two or three
fingers'.
参数
返回
this
重写了
定义于
event: "show" Windows
Emitted when the system context menu is triggered on the window, this is
normally only triggered when the user right clicks on the non-client area of
your window. This is the window titlebar or any area you have declared as
-webkit-app-region: drag in a frameless window.
Calling event.preventDefault() will prevent the menu from being displayed.
To convert point to DIP, use screen.screenToDipPoint(point).
参数
返回
this
重写了
定义于
event: "swipe"
Emitted when the window exits from a maximized state.
参数
返回
this
重写了
定义于
event: "system-context-menu"
Emitted before the window is moved. On Windows, calling event.preventDefault()
will prevent the window from being moved.
Note that this is only emitted when the window is being moved manually. Moving
the window with setPosition/setBounds/center will not emit this event.
参数
返回
this
重写了
定义于
event: "unmaximize"
Emitted before the window is resized. Calling event.preventDefault() will
prevent the window from being resized.
Note that this is only emitted when the window is being resized manually.
Resizing the window with setBounds/setSize will not emit this event.
The possible values and behaviors of the edge option are platform dependent.
Possible values are:
- On Windows, possible values are
bottom,top,left,right,top-left,top-right,bottom-left,bottom-right. - On macOS, possible values are
bottomandright.- The value
bottomis used to denote vertical resizing. - The value
rightis used to denote horizontal resizing.
- The value
参数
返回
this
重写了
定义于
event: "will-move"
参数
返回
this
重写了
BaseWindow.on
定义于
event: "will-resize"
参数
返回
this
重写了
BaseWindow.on
定义于
once()
event: "app-command" Windows
参数
返回
this
继承自
定义于
event: "blur"
参数
返回
this
继承自
定义于
event: "close"
参数
返回
this
继承自
定义于
event: "closed"
参数
返回
this
继承自
定义于
event: "will-enter-full-screen"
参数
返回
this
继承自
定义于
event: "enter-full-screen"
参数
返回
this
继承自
定义于
event: "focus"
参数
返回
this
继承自
定义于
event: "hide"
参数
返回
this
继承自
定义于
event: "will-leave-full-screen"
参数
返回
this
继承自
定义于
event: "leave-full-screen"
参数
返回
this
继承自
定义于
event: "maximize"
参数
返回
this
继承自
定义于
event: "minimize"
参数
返回
this
继承自
定义于
event: "move"
参数
返回
this
继承自
定义于
event: "moved"
参数
返回
this
继承自
定义于
event: "resize"
参数
返回
this
继承自
定义于
event: "resized"
参数
返回
this
继承自
定义于
event: "restore"
参数
返回
this
继承自
定义于
event: "always-on-top-changed"
参数
返回
this
继承自
定义于
event: "rotate-gesture" macOS
参数
返回
this
继承自
定义于
event: "session-end" Windows
参数
返回
this
继承自
定义于
event: "sheet-begin" macOS
参数
返回
this
继承自
定义于
event: "sheet-end" macOS
参数
返回
this
继承自
定义于
event: "new-window-for-tab" macOS
参数
返回
this
继承自
定义于
event: "show"
参数
返回
this
继承自
定义于
event: "swipe" macOS
参数
返回
this
继承自
定义于
event: "system-context-menu" Windows
参数
返回
this
继承自
定义于
event: "unmaximize"
参数
返回
this
继承自
定义于
event: "will-move"
参数
返回
this
继承自
定义于
event: "will-resize"
参数
返回
this
继承自
定义于
removeListener()
event: "app-command" Windows
参数
返回
this
继承自
定义于
event: "blur"
参数
返回
this
继承自
定义于
event: "close"
参数
返回
this
继承自
定义于
event: "closed"
参数
返回
this
继承自
定义于
event: "will-enter-full-screen"
参数
返回
this
继承自
定义于
event: "enter-full-screen"
参数
返回
this
继承自
定义于
event: "focus"
参数
返回
this
继承自
定义于
event: "hide"
参数
返回
this
继承自
定义于
event: "will-leave-full-screen"
参数
返回
this
继承自
定义于
event: "leave-full-screen"
参数
返回
this
继承自
定义于
event: "maximize"
参数
返回
this
继承自
定义于
event: "minimize"
参数
返回
this
继承自
定义于
event: "move"
参数
返回
this
继承自
定义于
event: "moved"
参数
返回
this
继承自
定义于
event: "resize"
参数
返回
this
继承自
定义于
event: "resized"
参数
返回
this
继承自
定义于
event: "restore"
参数
返回
this
继承自
定义于
event: "always-on-top-changed"
参数
返回
this
继承自
定义于
event: "rotate-gesture" macOS
参数
返回
this
继承自
定义于
event: "session-end" Windows
参数
返回
this
继承自
定义于
event: "sheet-begin" macOS
参数
返回
this
继承自
定义于
event: "sheet-end" macOS
参数
返回
this
继承自
定义于
event: "new-window-for-tab" macOS
参数
返回
this
继承自
定义于
event: "show"
参数
返回
this
继承自
定义于
event: "swipe" macOS
参数
返回
this
继承自
定义于
event: "system-context-menu" Windows
参数
返回
this
继承自
定义于
event: "unmaximize"
参数
返回
this
继承自
定义于
event: "will-move"
参数
返回
this
继承自
定义于
event: "will-resize"
参数
返回
this
继承自
定义于
restore()
Restores the window from minimized state to its previous state.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1248
selectNextTab() macOS
Selects the next tab when native tabs are enabled and there are other tabs in the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1309
selectPreviousTab() macOS
Selects the previous tab when native tabs are enabled and there are other tabs in the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1302
sendGlobalEvent()
Send global event to the window.
Lynx-side GlobalEventListener signature:
(...args) => { }
参数
返回
boolean
定义于
setAlwaysOnTop()
Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1254
setAspectRatio()
This will make a window maintain an aspect ratio. The extra size allows a developer to have space, specified in pixels, not included within the aspect ratio calculations. This API already takes into account the difference between a window's size and its content size.
Consider a normal window with an HD video player and associated controls. Perhaps there are 15 pixels of controls on the left edge, 25 pixels of controls on the right edge and 50 pixels of controls below the player. In order to maintain a 16:9 aspect ratio (standard aspect ratio for HD @1920x1080) within the player itself we would call this function with arguments of 16/9 and { width: 40, height: 50 }. The second argument doesn't care where the extra width and height are within the content view--only that they exist. Sum any extra width and height areas you have within the overall content view.
The aspect ratio is not respected when window is resized programmatically with
APIs like win.setSize.
To reset an aspect ratio, pass 0 as the aspectRatio value:
win.setAspectRatio(0).
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1289
setAutoHideCursor() macOS
Controls whether to hide cursor when typing.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1295
setAutoHideMenuBar() Windows
Sets whether the window menu bar should hide itself automatically. Once set the
menu bar will only show when users press the single Alt key.
If the menu bar is already visible, calling setAutoHideMenuBar(true) won't
hide it immediately.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1319
setBackgroundColor()
Examples of valid backgroundColor values:
- Hex
- #fff (shorthand RGB)
- #ffff (shorthand ARGB)
- #ffffff (RGB)
- #ffffffff (ARGB)
- RGB
rgb\(([^\d]+),\s*([^\d]+),\s*([^\d]+)\)- e.g. rgb(255, 255, 255)
- RGBA
rgba\(([^\d]+),\s*([^\d]+),\s*([^\d]+),\s*([^\d.]+)\)- e.g. rgba(255, 255, 255, 1.0)
- HSL
hsl\((-?[^\d.]+),\s*([^\d.]+)%,\s*([^\d.]+)%\)- e.g. hsl(200, 20%, 50%)
- HSLA
hsla\((-?[^\d.]+),\s*([^\d.]+)%,\s*([^\d.]+)%,\s*([^\d.]+)\)- e.g. hsla(200, 20%, 50%, 0.5)
- Color name
- Options are listed in SkParseColor.cpp
- Similar to CSS Color Module Level 3 keywords, but case-sensitive.
- e.g.
bluevioletorred
- e.g.
Sets the background color of the window. See Setting backgroundColor.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1347
setBounds()
Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.
On macOS, the y-coordinate value cannot be smaller than the menu bar height. The menu bar height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the menu bar height will result in a window that is flush to the menu bar.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1357
setClosable()
Sets whether the window can be manually closed by user.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1363
setContentBounds()
Resizes and moves the content area to the supplied bounds.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1516
setContentSize()
Sets the size of the content area.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1508
setEnabled()
Disable or enable the window.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1367
setFocusable()
Changes whether the window can be focused.
On macOS it does not remove the focus from the window.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1375
setFullScreen()
Sets whether the window should be in fullscreen mode.
On macOS, fullscreen transitions take place asynchronously. If further actions depend on the fullscreen state, use the 'enter-full-screen' or > 'leave-full-screen' events.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1383
setFullScreenable()
Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1388
setGlobalProps()
Set global props for the Lynx view.
This is the primary entry point for setting global props on the client side.
When called before the first template load, updates are cached and applied after the view is created and the first load finishes.
参数
返回
boolean
定义于
setHasShadow()
Sets whether the window should have a shadow.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1399
setHiddenInMissionControl()
参数
返回
void
继承自
BaseWindow.setHiddenInMissionControl
定义于
apis/api/base-window.d.ts:1389
setMaximizable()
Sets whether the window can be manually maximized by user.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1412
setMaximumSize()
Sets the maximum size of window to width and height.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1416
setMinimizable()
Sets whether the window can be manually minimized by user.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1422
setMinimumSize()
Sets the minimum size of window to width and height.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1426
setMovable()
Sets whether the window can be moved by user.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1432
setOpacity()
Sets the opacity of the window. Out of bound number values are clamped to the [0, 1] range.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1446
setParentWindow()
Sets parent as current window's parent window, passing null will turn
current window into a top-level window.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1451
setPosition()
Moves window to x and y.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1455
setProgressBar()
Sets progress value in progress bar. Valid range is [0, 1.0].
Remove progress bar when progress < 0; Change to indeterminate mode when progress > 1.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1463
setResizable()
Sets whether the window can be manually resized by the user.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1478
setSheetOffset() macOS
Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a custom client-rendered toolbar. For example:
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1486
setSimpleFullScreen() macOS
Enters or leaves simple fullscreen mode.
Simple fullscreen mode emulates the native fullscreen behavior found in versions of macOS prior to Lion (10.7).
参数
返回
void
继承自
BaseWindow.setSimpleFullScreen
定义于
apis/api/base-window.d.ts:1495
setSize()
Resizes the window to width and height. If width or height are below any
set minimum size constraints the window will snap to its minimum size.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1500
setSkipTaskbar()
Makes the window not show in the taskbar.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1526
setTitle()
Changes the title of native window to title.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1530
setTrafficLightPosition() macOS
Set a custom position for the traffic light buttons in frameless window. Passing
null will reset the position to default.
参数
返回
void
继承自
BaseWindow.setTrafficLightPosition
定义于
apis/api/base-window.d.ts:1585
setVibrancy() macOS
Adds a vibrancy effect to the window. Passing null or an empty string will
remove the vibrancy effect on the window.
参数
返回
void
继承自
定义于
apis/api/base-window.d.ts:1544
setVisibleOnAllWorkspaces() macOS
Sets whether the window should be visible on all workspaces.
This API does nothing on Windows.
[!NOTE] On macOS, Lynxtron currently applies only the window-level
collection behaviors (CanJoinAllSpaces and, if requested,
FullScreenAuxiliary). It does not currently implement Electron's Dock /
process-type transformation.
参数
返回
void
继承自
BaseWindow.setVisibleOnAllWorkspaces
定义于
apis/api/base-window.d.ts:1575
setWindowButtonVisibility() macOS
Sets whether the window traffic light buttons should be visible.
参数
返回
void
继承自
BaseWindow.setWindowButtonVisibility
定义于
apis/api/base-window.d.ts:1591
show()
Shows and gives focus to the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1595
showAllTabs() macOS
Shows or hides the tab overview when native tabs are enabled.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1395
showInactive()
Shows the window but doesn't focus on it.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1599
toggleTabBar() macOS
Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1537
unhookAllWindowMessages() Windows
Unhooks all of the window messages.
返回
void
继承自
BaseWindow.unhookAllWindowMessages
定义于
apis/api/base-window.d.ts:1605
unhookWindowMessage() Windows
Unhook the window message.
参数
返回
void
继承自
BaseWindow.unhookWindowMessage
定义于
apis/api/base-window.d.ts:1611
unmaximize()
Unmaximizes the window.
返回
void
继承自
定义于
apis/api/base-window.d.ts:1615
updateMetaData()
Updates the Lynx view with new template data.
This is the primary entry point for triggering template data updates on the client side.
meta.updateData: Template data content used to update the page.meta.globalProps: Global props content used to update the page.
When called before the first template load, updates are cached and applied after the view is created and the first load finishes.
参数
返回
boolean
定义于