pycocoa.windows.Window

Package pycocoa :: Module windows :: Class Window |
[frames] | no frames]

# Class Window

      object --+
               |
    bases._Type0 --+
                   |
        bases._Type1 --+
                       |
            bases._Type2 --+
                           |
                          Window

Known Subclasses:
  - MediaWindow
  - , tables.TableWindow
  - , TextWindow

Basic window Python Type, wrapping ObjC `NSWindow`.

Instance Methods
__init__(self, title=`'``Main``'`, screen=None, fraction=0.5, frame=None, excl=0, auto=False, **kwds) Create a new Window. |
cascade(self) Cascade window placement (from the top left screen corner). |
close(self) Close this window (by a click of the close button). |
front(self, focus=False) Order this window to the front. |
full(self, full) Enter or exit full screen mode for this window. |
hide(self, hide) Hide or unhide this window. |
limit(self, width=3840, height=4160) Limit this window's content size. |
windowCloseOK_(self) Is it OK? to close window callback. |
windowClose_(self) Closing window callback. |
windowKey_(self, key) Callback window becomes/resigns `Key`. |
windowMain_(self, main) Callback window becomes/resigns `Main`. |
windowPrint_(self) Print window callback. |
windowResize_(self) Resizing window callback. |
windowScreen_(self, change) Called window when screen or screen profile changed `Main`. |
windowZoomOK_(self, frame=None) Is it OK? to toggle zoom window callback. |
zoom(self, zoom) Toggle, zoom or un-zoom this window. |
Inherited from `bases._Type2`: `__str__` Inherited from `bases._Type0`: `__repr__`, `type2strepr` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__subclasshook__`

Properties
| NSview Get this window's view (`NSView...`).
| PMview Get this window's print view (`NSView...`).
| alpha Get this window's alpha value (`float`).
| frame Get this window's frame (Rect).
| isFull Get this window's full screen state (`bool`).
| isHidden Get this window's hidden state (`bool`).
| isKey Get this window's `Key` state (`bool`).
| isMain Get this window's `Main` state (`bool`).
| isPrintable Get this window's printable state (`bool`).
| isVisible Get this window's visible state (`bool`).
| isZoomed Get this window's zoomed state (`bool`).
| opaque Get this window's opaque setting (`bool`).
| ratio Get this window's contents' aspect ratio (2-tuple `(w, h)`).
| screen Get the screen of this window (Screen) or `None` if this window is off-screen.
| transparent Has this window been made transparent (`bool`)?
| transparentTitlebar Is this window's title bar transparent (`bool`)?
Inherited from `bases._Type2`: `title` Inherited from `bases._Type1`: `NSdelegate`, `app` Inherited from `bases._Type0`: `NS`, `NSDelegate` Inherited from `object`: `__class__`

Method Details

### __init__(self, title=`'``Main``'`, screen=None, fraction=0.5, frame=None, excl=0, auto=False, **kwds) (Constructor) |
Create a new Window. Parameters: `title` - Window title (`str`). `screen` - The screen to place the window on (`int`) or `None` for the current one. Use `screen=0` for the built-in screen or `screen=1` for the first external monitor, etc. `fraction` - Window size as fraction of the screen (`float`), defining the window `frame`. `frame` - The window's origin and content size (Rect, NSRect_t, NSRect4_t), overriding `fraction`. `excl` - Window styles to exclude (WindowStyle`.attribute`). `auto` - Release window resource when closed (`bool`). `kwds` - Optional, additional keyword arguments. Raises: `WindowError` - Unique `Id` exists. Overrides: object.__init__

### close(self) |
Close this window (by a click of the close button). Note: The `.windowWillClose_` action is invoked iff `.windowShouldClose_` returns True.

### front(self, focus=False) |
Order this window to the front. Parameters: `focus` - Make this window `Key` (`bool`).

### full(self, full) |
Enter or exit full screen mode for this window. Parameters: `full` - Enter or exit (`bool`).

### hide(self, hide) |
Hide or unhide this window. Parameters: `hide` - Hide or show (`bool`).

### limit(self, width=3840, height=4160) |
Limit this window's content size. Parameters: `width` - Width limit (`float` or `int`). `height` - Height limit (`float` or `int`).

### windowCloseOK_(self) |
Is it OK? to close window callback. Returns: True if OK to close, False otherwise.

### windowKey_(self, key) |
Callback window becomes/resigns `Key`. Parameters: `key` - Make or un-make `Key` (`bool`).

### windowMain_(self, main) |
Callback window becomes/resigns `Main`. Parameters: `main` - Make or un-make `Main` (`bool`).

### windowScreen_(self, change) |
Called window when screen or screen profile changed `Main`. Parameters: `change` - `True` if the screen or `False` if the profile changed (`bool`). Note: Typically, changing screen involves 2 callback invokations, once for the profile and once for the screen.

### windowZoomOK_(self, frame=None) |
Is it OK? to toggle zoom window callback. Parameters: `frame` - The frame to zoom to (Rect). Returns: True if OK to toggle, False otherwise.

### zoom(self, zoom) |
Toggle, zoom or un-zoom this window. Parameters: `zoom` - Zoom or un-zoom (`bool`) or `None` to toggle.

Property Details

### NSview Get this window's view (`NSView...`). Get Method: NSview(self) - Get this window's view (`NSView...`). Set Method: NSview(self, ns_view) - Set this window's view (`NSView...`).

### PMview Get this window's print view (`NSView...`). Get Method: PMview(self) - Get this window's print view (`NSView...`). Set Method: PMview(self, ns_view) - Set this window's print view (`NSView...`).

### alpha Get this window's alpha value (`float`). Get Method: alpha(self) - Get this window's alpha value (`float`). Set Method: alpha(self, alpha) - Set this window's alpha value (`float`, 0.0..1.0).

### frame Get this window's frame (Rect). Get Method: frame(self) - Get this window's frame (Rect). Set Method: frame(self, frame) - Set the frame of this window (Rect, `NSRect_t`, `NSRect4_t`, or None).

### isFull Get this window's full screen state (`bool`). Get Method: isFull(self) - Get this window's full screen state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isHidden Get this window's hidden state (`bool`). Get Method: isHidden(self) - Get this window's hidden state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isKey Get this window's `Key` state (`bool`). Get Method: isKey(self) - Get this window's `Key` state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isMain Get this window's `Main` state (`bool`). Get Method: isMain(self) - Get this window's `Main` state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isPrintable Get this window's printable state (`bool`). Get Method: isPrintable(self) - Get this window's printable state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isVisible Get this window's visible state (`bool`). Get Method: isVisible(self) - Get this window's visible state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isZoomed Get this window's zoomed state (`bool`). Get Method: isZoomed(self) - Get this window's zoomed state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### opaque Get this window's opaque setting (`bool`). Get Method: opaque(self) - Get this window's opaque setting (`bool`). Set Method: opaque(self, opaque) - Make this window opaque or not (`bool`).

### ratio Get this window's contents' aspect ratio (2-tuple `(w, h)`). Get Method: ratio(self) - Get this window's contents' aspect ratio (2-tuple `(w, h)`). Set Method: ratio(self, ratio) - Set this window's contents' aspect ratio.

### screen Get the screen of this window (Screen) or `None` if this window is off-screen. Get Method: screen(self) - Get the screen of this window (Screen) or `None` if this window is off-screen. Set Method: screen(self, screen) - Move this window to an other screen.

### transparent Has this window been made transparent (`bool`)? Get Method: transparent(self) - Has this window been made transparent (`bool`)? Set Method: transparent(self, transparent) - Make this window transparent or undo (`bool`).

### transparentTitlebar Is this window's title bar transparent (`bool`)? Get Method: transparentTitlebar(self) - Is this window's title bar transparent (`bool`)? Set Method: transparentTitlebar(self, transparent) - Make this window title bar transparent or undo (`bool`).