Sheet(posSize, parentWindow, minSize=None, maxSize=None, autosaveName=None)¶
A window that is attached to another window.
To add a control to a sheet, simply set it as an attribute of the sheet.:
from vanilla import Window, Sheet, Button class SheetDemo: def __init__(self): self.w = Window((240, 140), "Sheet Demo") self.w.openSheet = Button((10, -30, -10, 20), "open sheet", callback=self.openSheetCallback) self.w.open() def openSheetCallback(self, sender): self.sheet = Sheet((160, 70), self.w) self.sheet.closeSheet = Button((10, -30, -10, 20), "close sheet", callback=self.closeSheetCallback) self.sheet.open() def closeSheetCallback(self, sender): self.sheet.close() del self.sheet SheetDemo()
No special naming is required for the attributes. However, each attribute must have a unique name.
posSize Tuple of form (width, height) representing the size of the sheet.
parentWindow The window that the sheet should be attached to.
minSize Tuple of the form (width, height) representing the minimum size that the sheet can be resized to.
maxSize Tuple of the form (width, height) representing the maximum size that the sheet can be resized to.
autosaveName A string representing a unique name for the sheet. If given, this name will be used to store the sheet size in the application preferences.
Center the window within the screen.
Close the window.
Once a window has been closed it can not be re-opened.
A tuple of form (left, top, width, height) representing the window’s position and size.
The title in the window’s title bar.
Hide the window.
A boolean value representing if the window is visible or not.
Make the window the key window.
Make the window the main window.
Open the window.
Select the window if it is not the currently selected window.
Show the window if it is hidden.