pycocoa.apps.App

Package pycocoa :: Module apps :: Class App |
[frames] | no frames]

# Class App

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

Python `App` Type, wrapping an ObjC `NSApplication`.

Instance Methods
__init__(self, title=`'``PyCocao``'`, raiser=False, **kwds) New App. |
activate(self, active, force=True) Active or de-activate this app. |
append(self, menu) Add a menu to this app's menu bar. |
full(self, full) Enter or exit full screen mode for this app. |
hide(self, hide) Hide or show this app's windows. |
hideOther(self, hide) Hide other or show all apps's windows. |
run(self, timeout=None) Run this app (never returns). |
terminate(self) Terminate this app (never returns). |
appLaunched_(self, app) Callback, the app launched and is up. |
menuFullScreen_(self, item) Callback for `Full Screen` menu item. |
menuHide_(self, item) Callback for `Hide` menu item. |
menuOther_(self, item) Callback for `Hide/Show Other` menu item. |
menuTerminate_(self, item) Callback for `Quit` menu item. |
windowClose_(self, window) Closing window callback. |
windowCloseOK_(self, window) Is it OK? to close window callback. |
windowKey_(self, window) Callback window becomes/resigns `Key`. |
windowLast_(self, window) Callback window becomes `Key` or `Main`. |
windowMain_(self, window) Callback window becomes/resigns `Main`. |
windowPrint_(self, window) Print window callback. |
windowResize_(self, window) Resizing window callback. |
windowScreen_(self, window, change) Called when window screen or screen profile changed `Main`. |
windowZoomOK_(self, window, frame=None) Is it OK? to toggle zoom window callback. |
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
| badge Get this app's dock tile/badge (Tile).
| isActive Get this app's active state (`bool`).
| isHidden Get this app's hidden state (`bool`).
| isRunning Get this app's running state (`bool`).
| isUp Get this app's launched state (`bool`).
| keyWindow Get this app's key window (Window) or `None`.
| lastWindow Get this app's most recent key or main window (Window).
| mainWindow Get this app's main window (Window) or `None`.
| menubar Get this app's menu bar (MenuBar).
| raiser Get raise errors option (`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=`'``PyCocao``'`, raiser=False, **kwds) (Constructor) |
New App. Parameters: `title` - App name or title (`str`). `raiser` - Throw exceptions for silent errors (`bool`). `kwds` - Optional, additional keyword arguments. Raises: `RuntimeError` - Duplicate Apps. Overrides: object.__init__

### activate(self, active, force=True) |
Active or de-activate this app. Parameters: `active` - Activate or de-activate (`bool`). `force` - Activate regardless (`bool`), otheriwse only activate if no other app is active Returns: Previous `isActive` value (`bool`). See Also: activate(ignoringOtherApps flag: Bool).

### append(self, menu) |
Add a menu to this app's menu bar. Parameters: `menu` - The menu to add (Menu). Note: The first menu item of the bar menu is provided by default.

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

### hide(self, hide) |
Hide or show this app's windows. Parameters: `hide` - Hide or show (`bool`). Returns: Previous `isHidden` value (`bool`). See Also: unhideWithoutActivation.

### hideOther(self, hide) |
Hide other or show all apps's windows. Parameters: `hide` - Hide or show (`bool`).

### run(self, timeout=None) |
Run this app (never returns). Parameters: `timeout` - Run time limit in seconds (`float`). Note: Although run never returns, any Python threads started earlier continue to run concurrently.

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

### windowScreen_(self, window, change) |
Called when window screen or screen profile changed `Main`. Parameters: `change` - `True` if the screen or `False` if the profile changed (`bool`).

### windowZoomOK_(self, window, 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.

Property Details

### badge Get this app's dock tile/badge (Tile). Get Method: badge(self) - Get this app's dock tile/badge (Tile). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isActive Get this app's active state (`bool`). Get Method: isActive(self) - Get this app's active state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

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

### isRunning Get this app's running state (`bool`). Get Method: isRunning(self) - Get this app's running state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### isUp Get this app's launched state (`bool`). Get Method: isUp(self) - Get this app's launched state (`bool`). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### keyWindow Get this app's key window (Window) or `None`. Get Method: keyWindow(self) - Get this app's key window (Window) or `None`. Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### lastWindow Get this app's most recent key or main window (Window). Get Method: lastWindow(self) - Get this app's most recent key or main window (Window). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### mainWindow Get this app's main window (Window) or `None`. Get Method: mainWindow(self) - Get this app's main window (Window) or `None`. Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### menubar Get this app's menu bar (MenuBar). Get Method: menubar(self) - Get this app's menu bar (MenuBar). Set Method: Read_Only(self, ignored) - Throws an `AttributeError`, always.

### raiser Get raise errors option (`bool`). Get Method: raiser(self) - Get raise errors option (`bool`). Set Method: raiser(self, raiser) - Set the raise errors option (`bool`).