Skip to content

Instantly share code, notes, and snippets.

@danielwestendorf
Created June 17, 2011 17:03
Show Gist options
  • Save danielwestendorf/1031811 to your computer and use it in GitHub Desktop.
Save danielwestendorf/1031811 to your computer and use it in GitHub Desktop.
def show_modal
NSApp.beginSheet(@my_modal_window,
modalForWindow: @my_main_window,
modalDelegate: self,
didEndSelector:nil,
contextInfo:nil)
end
def cancel_modal(sender)
NSApp.endSheet(@my_modal_window)
@my_modal_window.orderOut(sender)
end
def submit_modal_form(sender)
value = @my_value_text_field.stringValue
NSApp.endSheet(@my_modal_window)
@my_modal_window.orderOut(sender)
#do something with value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment