Change window states
Last updated
Last updated
An ArcOS window has several different states, these are modes the window can apply to represent it in different ways. These states are available:
Minimized — Is this window hidden (minimized)?
Maximized — Is this window maximized?
Resizable — Can the user resize the window?
Headless — Does the window have no titlebar?
Fullscreen — Is the window fullscreen?
If you recall, these states are also documented (point 6) because you're asked about window states in the CLI's app creation wizard. The states have default values that you can set by modifying properties of the state
object in your _app.tpa
file.
You can't change the Resizable and Headless states dynamically, these will have to be decided upon before your app starts. Other than that, the methods for changing states are part of the App Renderer, so you'll have to manually invoke them from there. The snippets below are from inside your app's main process, here they are:
An ArcOS window can also be snapped to different corners or sides of the screen: top
, bottom
, left
, right
, top-left
, top-right
, bottom-left
, bottom-right
. These can be set programmatically too by calling AppRenderer.snapWindow
:
The first argument is the PID, and the second is the variant, which is one of the 8 options I listed earlier.