(title, message='', ok=None, cancel=False)
return alert.runModal()
Simple alert window.
Simple alert window.
Simple alert window .
def alert(title, message='', ok=None, cancel=False):
    """
    Simple alert window.
    """
    message = str(message)
    title = str(title)
    alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
        title, ok, 'Cancel' if cancel else None, None, message)
    alert.setAlertStyle_(0)  # informational style
    _log('alert opened with message: {}, title: {}'.format(repr(message), repr(title)))
    return alert.runModal()
def alert ( title , message = '' , ok = None , cancel = False ) : message = str ( message ) title = str ( title ) alert = NSAlert . alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_ ( title , ok , 'Cancel' if cancel else None , None , message ) alert . setAlertStyle_ ( 0 ) # informational style _log ( 'alert opened with message: {}, title: {}' . format ( repr ( message ) , repr ( title ) ) ) return alert . runModal ( )