source stringlengths 14 113 | code stringlengths 10 21.3k |
|---|---|
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('displayIdChange', (data) => {
console.info('Window displayId changed, displayId=' + JSON.stringify(data));
});
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (displayId: number) => {
// ...
}
try {
// Enable listening through the on API.
windowClass.on('displayIdChange', callback);
// Disable the listening of a specified callback.
windowClass.off('displayIdChange', callback);
// Unregister all the callbacks that have been registered through on()... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('windowVisibilityChange', (boolean) => {
console.info('Window visibility changed, isVisible=' + boolean);
});
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (bool: boolean) => {
// ...
}
try {
// Enable listening through the on API.
windowClass.on('windowVisibilityChange', callback);
// Disable the listening of a specified callback.
windowClass.off('windowVisibilityChange', callback);
// Unregister all the callbacks that have been registered th... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (density: number) => {
console.info('System density changed, density=' + JSON.stringify(density));
}
try {
windowClass.on('systemDensityChange', callback);
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (density: number) => {
// ...
}
try {
// Enable listening through the on API.
windowClass.on('systemDensityChange', callback);
// Disable the listening of a specified callback.
windowClass.off('systemDensityChange', callback);
// Unregister all the callbacks that have been registered throug... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('noInteractionDetected', 60, () => {
console.info('no interaction in 60s');
});
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = () => {
// ...
}
try {
windowClass.on('noInteractionDetected', 60, callback);
windowClass.off('noInteractionDetected', callback);
// Unregister all the callbacks that have been registered through on().
windowClass.off('noInteractionDetected');
} catch (exception) {
console.error(`Failed to ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('windowStatusChange', (WindowStatusType) => {
console.info('Succeeded in enabling the listener for window status changes. Data: ' + JSON.stringify(WindowStatusType));
});
} catch (exception) {
console.error(`Failed to unregister callback. Cause code: ${exception.code}, message: ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (windowStatusType: window.WindowStatusType) => {
// ...
}
try {
windowClass.on('windowStatusChange', callback);
windowClass.off('windowStatusChange', callback);
// Unregister all the callbacks that have been registered through on().
windowClass.off('windowStatusChange');
} catch (ex... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('windowStatusDidChange', (WindowStatusType) => {
console.info(`Succeeded in enabling the listener for window status changes. Data: ${JSON.stringify(WindowStatusType)}`);
});
} catch (exception) {
console.error(`Failed to unregister callback. Cause code: ${exception.code}, messag... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (windowStatusType: window.WindowStatusType) => {
// ...
}
try {
windowClass.on('windowStatusDidChange', callback);
windowClass.off('windowStatusDidChange', callback);
// Unregister all the callbacks that have been registered through on().
windowClass.off('windowStatusDidChange');
} ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
windowClass?.setUIContent('pages/Index', (error: BusinessError) => {
if (error.code) {
console.error(`Failed to set the content. Cause code: ${error.code}`);
return;
}
console.info('Succeeded in setting the content.');
let grayScale: number = 0.5;
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | windowClass.setUIContent('pages/WindowPage').then(() => {
try {
windowClass?.on('windowTitleButtonRectChange', (titleButtonRect) => {
console.info('Succeeded in enabling the listener for window title buttons area changes. Data: ' + JSON.stringify(titleButtonRect));
});
} catch (exception) {
consol... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | windowClass.setUIContent('pages/WindowPage').then(() => {
const callback = (titleButtonRect: window.TitleButtonRect) => {
// ...
}
try {
// Enable listening through the on API.
windowClass?.on('windowTitleButtonRectChange', callback);
// Disable the listening of a specified callback.
windowClass?.... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('windowRectChange', (data: window.RectChangeOptions) => {
console.info(`Succeeded window rect changes. Data: ` + JSON.stringify(data));
});
} catch (exception) {
console.error(`Failed to disable the listener for window rect changes. Cause code: ${exception.code}, message: ${exception.me... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (rectChangeOptions: window.RectChangeOptions) => {
// ...
}
try {
windowClass.on('windowRectChange', callback);
windowClass.off('windowRectChange', callback);
// Unregister all the callbacks that have been registered through on().
windowClass.off('windowRectChange');
} catch (exception) {
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = () => {
// ...
return true;
}
try {
windowClass.on('subWindowClose', callback);
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = () => {
// ...
return true;
}
try {
windowClass.on('subWindowClose', callback);
windowClass.off('subWindowClose', callback);
// Unregister all the callbacks that have been registered through on().
windowClass.off('subWindowClose');
} catch (exception) {
console.error(`Failed to register o... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
const callback = () => {
// ...
return new Promi... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
try {
const callback = () => {
// ...
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('windowHighlightChange', (data: boolean) => {
console.info(`Window highlight Change: ${data}`);
});
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (data: boolean) => {
// ...
}
try {
// Enable listening through the on API.
windowClass.on('windowHighlightChange', callback);
// Disable the listening of a specified callback.
windowClass.off('windowHighlightChange', callback);
// Unregister all the callbacks that have been registered thro... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | function calculateRect(info: window.RotationChangeInfo): window.Rect {
// calculate result with info
let rect : window.Rect = {
left: 0,
top: 0,
width: 500,
height: 600,
}
return rect;
}
const callback = (info: window.RotationChangeInfo): window.RotationChangeResult | void => {
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (info: window.RotationChangeInfo): window.RotationChangeResult | void => {
// ...
return;
}
try {
windowClass.off('rotationChange', callback);
// Unregister all the callbacks that have been registered through on().
windowClass.off('rotationChange');
} catch (exception) {
console.error(`Fail... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.on('uiExtensionSecureLimitChange', (data: boolean) => {
console.info(`Window secure limit Change: ${data}`);
});
} catch (exception) {
console.error(`Failed to register callback. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | const callback = (data: boolean) => {
// ...
}
try {
// Enable listening through the on API.
windowClass.on('uiExtensionSecureLimitChange', callback);
// Disable the listening of a specified callback.
windowClass.off('uiExtensionSecureLimitChange', callback);
// Unregister all the callbacks that have been r... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
windowClass.isWindowSupportWideGamut((err: BusinessError, data) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to check whether the window support WideGamut. Cause code: ${err.code}, message: ${err.message}`);
return;
}
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let promise = windowClass.isWindowSupportWideGamut();
promise.then((data) => {
console.info(`Succeeded in checking whether the window support WideGamut. Data: ${data}`);
}).catch((err: BusinessError) => {
console.error(`Failed to check whether the window suppo... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
windowClass.setWindowColorSpace(window.ColorSpace.WIDE_GAMUT, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to set window colorspace. Cause code: ${err.code}, message: ${err.message}`);
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let promise = windowClass.setWindowColorSpace(window.ColorSpace.WIDE_GAMUT);
promise.then(() => {
console.info('Succeeded in setting window colorspace.');
}).catch((err: BusinessError) => {
console.error(`Failed to set window colorspace. Cause ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let colorSpace = windowClass.getWindowColorSpace();
console.info(`Succeeded in getting the window color space. ColorSpace: ${colorSpace}`);
} catch (exception) {
console.error(`Failed to set the window to be focusable. Cause code: ${exception.code}, me... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
import { ColorMetrics } from '@kit.ArkUI';
let storage: LocalStorage = new LocalStorage();
storage.setOrCreate('storageSimpleProp', 121);
windowClass.loadContent("pages/page2", storage, (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreate');
let windowClass: window.Wind... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreate');
let windowClass: window.Wind... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isFocusable: boolean = true;
try {
windowClass.setWindowFocusable(isFocusable, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to set the window to be focusable. Cause code: ${err.code}, message:... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isFocusable: boolean = true;
try {
let promise = windowClass.setWindowFocusable(isFocusable);
promise.then(() => {
console.info('Succeeded in setting the window to be focusable.');
}).catch((err: BusinessError) => {
console.error(`Failed to set t... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { ColorMetrics, window } from '@kit.ArkUI';
try {
let promise =
window.setStartWindowBackgroundColor("entry", "EntryAbility", ColorMetrics.numeric(0xff000000));
promise.then(() => {
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isKeepScreenOn: boolean = true;
try {
windowClass.setWindowKeepScreenOn(isKeepScreenOn, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to set the screen to be always on. Cause code: ${err.code},... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isKeepScreenOn: boolean = true;
try {
let promise = windowClass.setWindowKeepScreenOn(isKeepScreenOn);
promise.then(() => {
console.info('Succeeded in setting the screen to be always on.');
}).catch((err: BusinessError) => {
console.error(`Failed... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isPrivacyMode: boolean = true;
try {
windowClass.setWindowPrivacyMode(isPrivacyMode, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to set the window to privacy mode. Cause code: ${err.code}, me... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isPrivacyMode: boolean = true;
try {
let promise = windowClass.setWindowPrivacyMode(isPrivacyMode);
promise.then(() => {
console.info('Succeeded in setting the window to privacy mode.');
}).catch((err: BusinessError) => {
console.error(`Failed to... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isTouchable = true;
try {
windowClass.setWindowTouchable(isTouchable, (err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to set the window to be touchable. Cause code: ${err.code}, message: ${err.me... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let isTouchable: boolean = true;
try {
let promise = windowClass.setWindowTouchable(isTouchable);
promise.then(() => {
console.info('Succeeded in setting the window to be touchable.');
}).catch((err: BusinessError) => {
console.error(`Failed to set t... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
import { image } from '@kit.ImageKit';
windowClass.snapshot((err: BusinessError, pixelMap: image.PixelMap) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to snapshot window. Cause code: ${err.code}, message: ${err.message}`);
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
import { image } from '@kit.ImageKit';
let promise = windowClass.snapshot();
promise.then((pixelMap: image.PixelMap) => {
console.info('Succeeded in snapshotting window. Pixel bytes number: ' + pixelMap.getPixelBytesNumber());
pixelMap.release(); // Release th... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
import { image } from '@kit.ImageKit';
let promise = windowClass.snapshotIgnorePrivacy();
promise.then((pixelMap: image.PixelMap) => {
console.info('Succeeded in snapshotting window. Pixel bytes number: ' + pixelMap.getPixelBytesNumber());
pixelMap.release(); ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
let windowClass: window.Window = ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
let windowClass: window.Window = ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
let windowClass: window.Window = ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
let windowClass: window.Window = ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
windowClass.minimize((err: BusinessError) => {
const errCode: number = err.code;
if (errCode) {
console.error(`Failed to minimize the window. Cause code: ${err.code}, message: ${err.message}`);
return;
}
console.info('Succeeded in minimizing the wi... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let promise = windowClass.minimize();
promise.then(() => {
console.info('Succeeded in minimizing the window.');
}).catch((err: BusinessError) => {
console.error(`Failed to minimize the window. Cause code: ${err.code}, message: ${err.message}`);
}); |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage) {
console.info('onWindowStageCreate');
let windowClass: window.Window | u... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let enabled = false;
windowClass.setResizeByDragEnabled(enabled, (err) => {
if (err.code) {
console.error(`Failed to set the function of disabling the resize by drag window. Cause code: ${err.code}, message: ${err.message}`);
return;
}
console.info(`Succeeded in setting the function of... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let enabled = false;
let promise = windowClass.setResizeByDragEnabled(enabled);
promise.then(() => {
console.info(`Succeeded in setting the function of disabling the resize by drag window.`);
}).catch((err: BusinessError) => {
console.error(`... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreate');
let windowClass: window.Wind... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage): void {
try {
let windowClass = windowStage.getMainWindowSync();
// Call m... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let windowLimits = windowClass.getWindowLimits();
} catch (exception) {
console.error(`Failed to obtain the window limits of window. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let windowLimits: window.WindowLimits = {
maxWidth: 1500,
maxHeight: 1000,
minWidth: 500,
minHeight: 400
};
let promise = windowClass.setWindowLimits(windowLimits);
promise.then((data) => {
console.info('Succeeded in changing the... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let windowLimits: window.WindowLimits = {
maxWidth: 1500,
maxHeight: 1000,
minWidth: 100,
minHeight: 100
};
let promise = windowClass.setWindowLimits(windowLimits, true);
promise.then((data) => {
console.info('Succeeded in changing... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let windowMask: Array<Array<number>> = [
[0, 0, 0, 1, 0, 0, 0],
[0, 0, 1, 1, 1, 0, 0],
[0, 1, 1, 0, 1, 1, 0],
[1, 1, 0, 0, 0, 1, 1]
];
let promise = windowClass.setWindowMask(windowMask);
promise.then(() => {
console.in... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.keepKeyboardOnFocus(true);
} catch (exception) {
console.error(`Failed to keep keyboard onFocus. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let storage: LocalStorage = new LocalStorage();
storage.setOrCreate('storageSimpleProp', 121);
windowClass.loadContent("pages/page2", storage, (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error(`Failed to load the content... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | let isVisible: boolean | undefined = undefined;
windowClass.setUIContent('pages/WindowPage').then(() => {
try {
isVisible = windowClass?.getWindowDecorVisible();
} catch (exception) {
console.error(`Failed to get the window decor visibility. Cause code: ${exception.code}, message: ${exception.message}`);
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
let windowClass: window.Window | undefined = undefined;
try {
let promise = window.getLastWindow(this.context);
promise.then((data) => {
windowClass = data;
let title = "title";
windowClass.setWindowTitle(title)... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage): void {
try {
windowStage.loadContent("pages/Index").then(() =>{
let windowClass = windowStage.getMainWindowSync();
let... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreate');
let windowClass: window.Wind... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | windowClass.setUIContent('pages/WindowPage').then(() => {
let height: number = 50;
try {
windowClass?.setWindowDecorHeight(height);
console.info(`Succeeded in setting the height of window decor: ${height}`);
} catch (exception) {
console.error(`Failed to set the height of window decor. Cause code: ${e... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { ConfigurationConstant } from '@kit.AbilityKit';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage): void {
try {
windowStage.loadContent("pages/Index").then(() =>{
let w... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let decorButtonStyle = windowClass.getDecorButtonStyle();
console.info('Succeeded in getting the style of button. Data: ' + JSON.stringify(decorButtonStyle));
} catch (exception) {
console.error(`Failed to get the style of button. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | windowClass.setUIContent('pages/WindowPage').then(() => {
try {
let height = windowClass?.getWindowDecorHeight();
console.info(`Succeeded in getting the height of window decor: ${height}`);
} catch (exception) {
console.error(`Failed to get the height of window decor. Cause code: ${exception.code}, mess... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreate');
let windowClass: window.Wind... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let windowStatusType = windowClass.getWindowStatus();
} catch (exception) {
console.error(`Failed to obtain the window status of window. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let focus = windowClass.isFocused();
console.info('Succeeded in checking whether the window is focused. Data: ' + JSON.stringify(focus));
} catch (exception) {
console.error(`Failed to check whether the window is focused. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let options : window.SubWindowOptions = {
title: 'title',
decorEnabled: true,
isModal: true
};
let promise = windowClass.createSubWindowWithOptions('mySubWindow', options);
promise.then((data) => {
console.info('Succeeded in creating ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let windowClass: window.Window = window.findWindow("subWindow");
let newParentWindow: window.Window = window.findWindow("newParentWindow");
let newParentWindowId: number = newParentWindow.getWindowProperties().id;
let promise = windowClass.setParentW... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let windowClass: window.Window = window.findWindow("subWindow");
let parentWindow: window.Window = windowClass.getParentWindow();
let properties = parentWindow.getWindowProperties();
console.info('Succeeded in obtaining parent window properties. Property: ' + JSON.stringify(properties));
} catch (exceptio... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage): void {
// Load the page corresponding to the mai... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // ets/pages/Index.ets
import { window } from '@kit.ArkUI';
import { common } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
let windowClass: window.Window | undefined;
let keyUpEventAry: string[] = [];
@Entry
@Component
struct Index {
private context = (this.getUIContext()?.getHostC... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { window } from '@kit.ArkUI';
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { window } from '@kit.ArkUI';
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreate');
let windowClass: window.Window | unde... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // ets/pages/Index.ets
@Entry
@Component
struct Index {
@State message: string = 'Hello World'
build() {
RelativeContainer() {
Text(this.message)
.id('HelloWorld')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.height('100%')
.width('100%')
}
onBackPress(): boolean ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
windowClass.enableDrag(true).then(() => {
console.info('succeeded in setting window draggable');
}).catch((err: BusinessError) => {
console.error(`Failed to set window draggable. Cause code: ${err.code}, message: ${err.message}`);
});
} catch ... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // ets/pages/Index.ets
import { BusinessError } from '@kit.BasicServicesKit';
@Entry
@Component
struct Index {
build() {
Row() {
Column() {
Blank('160')
.color(Color.Blue)
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
try {
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // ets/pages/Index.ets
import { BusinessError } from '@kit.BasicServicesKit';
@Entry
@Component
struct Index {
build() {
Row() {
Column() {
Blank('160')
.color(Color.Blue)
.onTouch((event: TouchEvent) => {
if (event.type === TouchType.Down) {
try {
... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage) {
try {
let windowClass = windowStage.getM... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { UIAbility } from '@kit.AbilityKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
// ...
onWindowStageCreate(windowStage: window.WindowStage): void {
console.info('onWindowStageCreat... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
windowClass.setWindowShadowRadius(4.0);
} catch (exception) {
console.error(`Failed to set shadow. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try{
let promise = windowClass.setWindowCornerRadius(1.0);
promise.then(() => {
console.info('Succeeded in setting window corner radius.');
}).catch((err: BusinessError) => {
console.error(`Failed to set window corner radius. Cause code: ${err.code},... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | try {
let cornerRadius = windowClass.getWindowCornerRadius();
} catch (exception) {
console.error(`Failed to get corner radius. Cause code: ${exception.code}, message: ${exception.message}`);
} |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
let exclusivelyHighlighted: boolean = true;
try {
let promise = windowClass.setExclusivelyHighlighted(exclusivelyHighlighted);
promise.then(() => {
console.info('Succeeded in setting the window to be exclusively highlight.');
}).catch((err: BusinessError... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let isHighlighted = windowClass.isWindowHighlighted();
console.info(`Succeeded in getting the window highlight status: ${isHighlighted}`);
} catch (exception) {
console.error(`Failed to get the window highlight status.. Cause code: ${exception.code}, m... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | import { BusinessError } from '@kit.BasicServicesKit';
try {
let windowClass: window.Window = window.findWindow("subWindow");
let enabled: boolean = true;
let promise = windowClass?.setFollowParentMultiScreenPolicy(enabled);
promise.then(() => {
console.info('Succeeded in setting the sub window supports mu... |
application-dev\reference\apis-arkui\arkts-apis-window-Window.md | // EntryAbility.ets
import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';
import { UIAbility } from '@kit.AbilityKit';
export default class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage: window.WindowStage): void {
windowStage.loadContent('pages/Index', (l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.