WinBounds:
Filter:
adclib/Classes (extension) | GUI

WinBounds
ExtensionExtension

a class that stores and restores window bounds

Description

WinBounds allows easy storing of window bounds in order to simplify designing and using multi-window guis. WinBounds is a class-only singleton.

First code examples:

WinBounds can also be use to store window-making functions,

WinBounds uses some extensions to the Window class :

Class Methods

.stored

a dict with all stored bounds for windows. window names must be unique!

.put

put in bounds rect by window name

.at

Arguments:

key

get bounds rect for key

.storeAll

store bounds of all currently open windows

.restoreAll

restore all open windows to their stored bounds.

.saveString

returns a code string that recreates stored bounds.

.putAll

add a collection - a dict or keys-values-array - to stored dict.

.store

store bounds rect of a currently open window by window name.

.storeWin

store bounds rect of a currently open window

.restoreWin

Arguments:

win

restore bounds rect of a currently open windo.

.restore

Arguments:

name

restore bounds rect of a currently open window by window name.

.makeFuncs

a dictionary of window-making functions

.addMake

add a make function to makeFuncs by name

.make

make the window with that name

.showOrMake

if a window with that name exists, move it to its position if not, make the window by running its named makefunc (see examples) s