Window
Properties
MacGap.Window.x
Window’s current X coordinate.
Example usage
var xPos = MacGap.Window.x;
MacGap.Window.y
Window’s current Y coordinate.
Example usage
var yPos = MacGap.Window.y;
MacGap.Window.isMaximized
Is the window maximized.
Example usage
var isMaximized = MacGap.Window.isMaximized;
Methods
MacGap.Window.open(url)
url
is a string
Open a new window, containing a webview loaded with the specified URL.
Example usage
MacGap.Window.open('http://apple.com');
MacGap.Window.move(x, y)
x
and y
are integers.
Move the window to the specified x, y coordinates.
Example usage
MacGap.Window.move(300, 200);
MacGap.Window.resize(width, height)
width
and height
are integers.
Resize the window to the specified width and height.
Example usage
MacGap.Window.resize(500, 300);
MacGap.Window.title(newTitle)
newTitle
is a string.
Change the window title to newTitle.
NOTE: when first opened, the window title is specified in the config.json
configuration file. See (App Configuration)[https://macgapproject.github.io/documentation/doc/app-configuration.html].
Example usage
MacGap.Window.title('My New Window Title');
MacGap.Window.maximize()
Maximize the window.
Example usage
MacGap.Window.maximize();
MacGap.Window.minimize()
Minimize the window.
Example usage
MacGap.Window.minimize();
MacGap.Window.restore()
Restore a minimized window.
Example usage
MacGap.Window.restore();
MacGap.Window.toggleFullscreen()
Toggle the window to and from full-screen.
Example usage
// Make the window full-screen.
MacGap.Window.toggleFullscreen();
// Wait 5 seconds then make the window not full-screen.
window.setInterval(function(){
MacGap.Window.toggleFullscreen();
}, 5000);