Windows
Managing Windows Programmatically
Windows that are created with ToDesktop Builder can be managed programmatically through the @todesktop/client-core
API.
Getting the Window ID
After you have configured your window, take note of the "Window ID" value. This is the identifier for your windows, and can be used to manage the window programmatically from your app code. Copy this value to your clipboard.
Managing the Window from your app code.
To manage a window programmatically, you'll need the @todesktop/client-core
NPM package installed in your project. From this package, we'll import the following:
object
exposes functions for retrieving primitives such as trays and windows.nativeWindow
exposes functions for manipulating windows.
With @todesktop/client-core
installed, managing a window is as a simple as retrieving the window reference and calling the nativeWindow
utility functions. For example, we can do the following to show the window and get the window dimensions: