Changeset 282
- Timestamp:
- 11/13/08 13:50:30 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/vanilla/trunk/Lib/vanilla/vanillaWindows.py
r206 r282 51 51 52 52 def __init__(self, posSize, title="", minSize=None, maxSize=None, textured=False, 53 autosaveName=None, closable=True, miniaturizable=True, initiallyVisible=True ):53 autosaveName=None, closable=True, miniaturizable=True, initiallyVisible=True, screen=None): 54 54 """ 55 55 *posSize* Tuple of form (left, top, width, height) representing the position and size of the window. It may also be a tuple of form (width, height). In this case, the window will be positioned on screen automatically. … … 70 70 71 71 *initiallyVisible* Boolean value representing if the window will be initially visible. Default is True. If False, you can show the window later by calling window.show(). 72 73 *screen* A "NSScreen":http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html object indicating the screen that the window should be drawn to. When None the window will be drawn to the main screen. 72 74 """ 73 75 mask = self.nsWindowStyleMask … … 89 91 l, t, w, h = posSize 90 92 cascade = False 91 frame = _calcFrame(NSScreen.mainScreen().visibleFrame(), ((l, t), (w, h))) 92 self._window = self.nsWindowClass.alloc().initWithContentRect_styleMask_backing_defer_( 93 frame, mask, NSBackingStoreBuffered, False) 93 if screen is None: 94 screen = NSScreen.mainScreen() 95 frame = _calcFrame(screen.visibleFrame(), ((l, t), (w, h))) 96 self._window = self.nsWindowClass.alloc().initWithContentRect_styleMask_backing_defer_screen_( 97 frame, mask, NSBackingStoreBuffered, False, screen) 94 98 if autosaveName is not None: 95 99 # This also sets the window frame if it was previously stored. … … 593 597 def __init__(self, posSize, title="", minSize=None, maxSize=None, 594 598 textured=False, autosaveName=None, closable=True, 595 initiallyVisible=True ):599 initiallyVisible=True, screen=None): 596 600 """ 597 601 *posSize* Tuple of form (left, top, width, height) representing the position and size of the window. It may also be a tuple of form (width, height). In this case, the window will be positioned on screen automatically. … … 608 612 609 613 *closable* Boolean value representing if the window should have a close button in the title bar. 614 615 *screen* A "NSScreen":http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSScreen_Class/Reference/Reference.html object indicating the screen that the window should be drawn to. When None the window will be drawn to the main screen. 610 616 """ 611 617 super(FloatingWindow, self).__init__(posSize, title, minSize, maxSize, 612 textured, autosaveName, closable, initiallyVisible=initiallyVisible )618 textured, autosaveName, closable, initiallyVisible=initiallyVisible, screen=screen) 613 619 self._window.setBecomesKeyOnlyIfNeeded_(True) 614 620
