PDA

View Full Version : Mac Equivalent of MessageBox


Puzzler183
2005.02.05, 07:55 PM
It has always irritated me that I couldn't find the Mac equivalent of MessageBox (on Windows). For my crossplatform things, I always end up just writing asserts to a file or not using them when testing on Mac... I looked through the apple developer site and was surprised to find something even more difficult to navigate and search than MSDN!

So now that I'm actually posting here, I figure it's time to find out: is there is a simple (read: I don't have to create it button by button) function that will do something like MessageBox?

belthaczar
2005.02.05, 09:12 PM
Is this what you want?

Dialog Manager Reference: Creating Alert Boxes (http://developer.apple.com/documentation/Carbon/Reference/Dialog_Manager/dialog_mgr_ref/function_group_1.html)

I found it by going to http://developer.apple.com, clicking on advanced search, and limiting the search to documentation only. I did a search for "dialog box" and the pages I found indicated that I really wanted to search for "alert". The above link was the first thing that came up.

OneSadCookie
2005.02.05, 09:13 PM
Several different ones.

For Cocoa, take a look at NSRunAlertPanel and friends.
For Carbon, try CFUserNotificationDisplayNotice and friends.

And of course, it's not difficult to create a custom one for yourself with a nib file...

belthaczar
2005.02.05, 09:21 PM
Is this what you want?


Bleh, after reading through it, I'm pretty sure it's definitely not what you want.

wadesworld
2005.02.05, 09:56 PM
Bleh, after reading through it, I'm pretty sure it's definitely not what you want.

No, it is. He wants StandardAlert(), which is on that page.

Wade

Puzzler183
2005.02.05, 11:20 PM
Excellent, thankyou. I don't work with Mac specifically so that's really helpful:).