I’ve been struggling to get a popover to detach to a window. Any tips?
Thanks so much!!!
script AppDelegate
property parent : class "NSObject"
-- IBOutlets
property theWindow : missing value
property popOver : missing value
property popoverTriggerButton : missing value
property popoverWindow : missing value
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
popOver's popoverShouldDetach:true
popOver's detachableWindowForPopover:popoverWindow
end applicationWillFinishLaunching_
on togglePopover:sender
if sender's state() is 1 then
popOver's showRelativeToRect:(sender's |bounds|()) ofView:sender preferredEdge:(current application's NSMinYEdge)
else
popOver's performClose:sender
end if
end togglePopover:
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
end script