I’ve been struggling to get a popover to detach to a window. Any tips?
Thanks so much!!!
property parent : class "NSObject"
property theWindow : missing value
property popOver : missing value
property popoverTriggerButton : missing value
property popoverWindow : missing value
-- Insert code here to initialize your application before any files are opened
if sender's state() is 1 then
popOver's showRelativeToRect:(sender's |bounds|()) ofView:sender preferredEdge:(current application's NSMinYEdge)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
By the look of things you need to declare a delegate of your popover, and in that have a -detachableWindowForPopover: method. When this is called, it should return a window, and the popover will then animate to appear as though it morphs into the window. IOW, there’s a fair amount of work involved.
Thanks for the reply!!! Earlier today, after a lot of trial & error, I finally got it to work and it looks so simple . I guess I didn’t quite grasp how the delegate method worked.
I had to connect the app delegate to be the delegate for the popover, and set a function for the popoverShouldDetatch method, returning true. Then just call the function in the finished launching function.