AndrewBelt / osdialog

A cross platform wrapper for OS dialogs like file save, open, message boxes, inputs, color picking, etc.
Creative Commons Zero v1.0 Universal
124 stars 21 forks source link

How to bring windows to front in xCode? #18

Open Jimw338 opened 3 years ago

Jimw338 commented 3 years ago

I can compile the test file fine in xCode (12, on Big Sur 11.1), and will run correctly if I run the completed project in the Finder or terminal, but if I run it in xCode, it won't display on top of the xCode window. Is there a way to force the window to the front? "makeKeyAndOrderFront" isn't a method of "NSAlert" (why isn't NSAlert a subclass of NSWindow?), nor did calling "[[NSRunningApplication currentApplication] activateWithOptions: NSApplicationActivateIgnoringOtherApps];" work.

Ideas?

AndrewBelt commented 3 years ago

NSAlerts definitely behave strangely when launched from Terminal. I don't personally use osdialog in terminal applications, but if you can figure out how to make osdialog_message and osdialog_prompt open the alerts on top of other windows, let me know on this issue or a PR.