Page 2 of 2
Re: Cross Platform MessageRequester
Posted: Tue Oct 06, 2015 5:49 pm
by wilbert
Keya wrote:The following is a mashup mostly based on code in this thread but also some by wilbert to add Mac OSX support, although the Mac part doesn't support the ability to specify a parent window (it seems the NSAlert object doesnt have that capability?)
You can set a parent window on OSX but I don't know if it is used a lot and haven't tested it on older versions of OSX.
Code: Select all
CocoaMessage(0, CocoaMessage(0, Alert, "window"), "setParentWindow:", WindowID(#ParentWindow))
Re: Cross Platform MessageRequester
Posted: Tue Oct 06, 2015 5:59 pm
by Keya
wilbert i did try setParentWindow when i was writing it but it seemed to be complaining that NSAlert didnt support it, so it seems thats just for regular dialogs? retrying now to confirm
[Update] It seems to be working fine, i think it's just because when i was trying it i didn't have that second embedded CocoaMessage so i was throwing the bone to the wall not the dog

Code updated! Many thanks again!!!
Re: Cross Platform MessageRequester
Posted: Tue Oct 06, 2015 7:00 pm
by wilbert
Keya wrote:i think it's just because when i was trying it i didn't have that second embedded CocoaMessage
That's exactly it. You need to use the window property of the alert object.
It's funny what you can do with it. For example also changing the background color of the alert.
Code: Select all
CocoaMessage(0, CocoaMessage(0, Alert, "window"), "setBackgroundColor:", CocoaMessage(0, 0, "NSColor yellowColor"))
Re: Cross Platform MessageRequester
Posted: Tue Oct 06, 2015 9:45 pm
by davido
Thank you for sharing, excellent.