• Jan Djärv's avatar
    Improve NS dialogs. Add close button, remove ugly casts. · 7f8941d8
    Jan Djärv authored
    * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
    button_values to NULL. Call setStykeMask so dialogs get a close button.
    (windowShouldClose:): Set window_closed.
    (dealloc): New member, free button_values.
    (process_dialog:): Make member function. Remove window argument,
    replace window with self. Count buttons and allocate and store values
    in button_values.
    (addButton:value:row:): value is int with the name tag.  Call setTag
    with tag. Remove return self, declare return value as void.
    (addString:row:): Remove return self, declare return value as void.
    (addSplit): Remove return self, declare return value as void.
    (clicked:): Remove return self, declare return value as void.
    Set dialog_return to button_values[seltag]. Code formatting change.
    (initFromContents:isQuestion:): Adjust call to process_dialog.
    Code formatting change.
    (timeout_handler:): Set timer_fired to YES.
    (runDialogAt:): Set timer_fired to NO.
    Handle click on close button as quit.
    
    * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
    Add window_closed and button_values.  Add void as return value for
    add(Button|String|Split).  addButton takes int instead of Lisp_Object.
    Add process_dialog as new member.
    7f8941d8
ChangeLog 637 KB