pycocoa.panels.AlertPanel

Package pycocoa :: Module panels :: Class AlertPanel |
[frames] | no frames]

# Class AlertPanel

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

Known Subclasses:
  - ErrorPanel
  - , TextPanel

Python Type to show an alert, wrapping ObjC `NSAlert`.

Instance Methods
__init__(self, title='', info='', ok=`'``OK``'`, cancel=False, other=False, style=1, suppressable=False) New AlertPanel. |
show(self, text='', font=None, timeout=None) Show alert message iff not suppressed. |
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
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='', info='', ok=`'``OK``'`, cancel=False, other=False, style=1, suppressable=False) (Constructor) |
New AlertPanel. Parameters: `title` - The panel name and title (`str`). `info` - Optional, informative message (`str`). `ok` - First, OK button text (`str`), other than 'OK'. `cancel` - Include a second, Cancel button (`bool` or `str`). `other` - Include a third, Other button (`bool` or `str`). `style` - Kind of alert (`AlertStyle`), default `.Info`. `suppressable` - Include suppress option (`bool`). Raises: `ValueError` - Multi-line info or too long. Overrides: object.__init__ Note: The first, `OK` button is always shown. The info text is limited to about 50 characters and must be without `linesep`arators.

### show(self, text='', font=None, timeout=None) |
Show alert message iff not suppressed. Parameters: `text` - Optional, accessory text (`str`). `font` - Optional font (Font), default `Fonts.System`. `timeout` - Optional time limit (`float`). Returns: The button clicked (`PanelButton`). If `PanelButton.Suppressed` is returned, the alert panel was not shown since it was suppressed due to a previous selection of the corresponding check box. `PanelButton.TimedOut` is returned if no button was clicked before the timeout expired.