C++: MessageBox with MacosX?

Hi

Did someone knows an equivalent to messagebox function working with macosX?
I really need a simple function like this, in C++, to continue my development!

Thank you

macbook, Mac OS X (10.5.5), Have all kind of computer & Os except Novell IBM & BeOS

Posted on Oct 17, 2008 7:59 AM

Reply
23 replies

Oct 18, 2008 5:26 PM in response to etresoft

etresoft wrote:
While I congratulate people on finding that MacOS 8.5 Appearance Manager function, there is no reason why you can't have some Cocoa source files that export their behavior as pure C functions. You don't really want your App stuck in that pre-MacOS X compatibility world.


Stuck like iTunes, Final Cut, DVD Studio Pro, Logic and all the other top dollar flagship applications that are still Carbon?

Here's the Appearance Manager's documentation:

http://developer.apple.com/documentation/Carbon/Reference/Appearance_Manager/Ref erence/reference.html

Point to where it is that you're seeing that function in it.

Oct 18, 2008 5:52 PM in response to orangekay

orangekay wrote:
Point to where it is that you're seeing that function in it.


Actually, it is the "StandardAlert" function I was looking at. I was trying to find out what "CreateStandardAlert" was creating and why I didn't know about it. I'm greatly annoyed when I post a poor response to someone's question.

Stuck like iTunes, Final Cut, DVD Studio Pro, Logic and all the other top dollar flagship applications that are still Carbon?


Yes. Stuck like those. Aren't they the ones that everyone complained about because 10.5 came out and they didn't work?

All I am trying to do is get the original poster to use something modern. I'm very skeptical about the C++ requirement. If an app runs on MacOS X, I'm pretty sure it can do at least some Objective-C.

I really don't see what benefit calling "CreateStandardDialog" and "RunStandardAlert" is to the original poster over calling just "NSRunAlertPanel". You could probably use NSRunAlertPanel without including anything. Try:

int NSRunAlertPanel (
CFStringRef title,
CFStringRef msg,
CFStringRef defaultButton,
CFStringRef alternateButton,
CFStringRef otherButton,
...
);

and then just call it.

Oct 18, 2008 8:15 PM in response to etresoft

etresoft wrote:
Actually, it is the "StandardAlert" function I was looking at. I was trying to find out what "CreateStandardAlert" was creating and why I didn't know about it. I'm greatly annoyed when I post a poor response to someone's question.


I'll admit that I don't have a copy of The Fragmalyzer handy to verify, but StandardAlert still wasn't a symbol exported by the Appearance Manager library as far as I can recall. What else ya got?

etresoft wrote:
Yes. Stuck like those. Aren't they the ones that everyone complained about because 10.5 came out and they didn't work?


Oh right, I forgot that none of these products work anymore--probably because I've actually used them, but we can't let that count for much. And Cocoa apps are guaranteed never to be broken by future OS releases because of what? Love?

Your Carbon malignment crusade would be a lot more convincing if you were able to express your extraordinarily skewed opinions of it in such a way as to indicate that you had actually used the library--or any of its predecessors--in some meaningful capacity.

Oct 19, 2008 1:54 AM in response to ericmeyers

I have to use C++ for 2 reasons:
-My program has to run with Windows & Linux too, the C++ is a good language for compatibility.
-SDL is written in C++...

"Do me a favor Glo and mark this thread as answered."
But this thread is actually unanswered:
Because I don't know how to use carbon ressources in my SDL project, I can't have messagebox (or alert) with MacOSX!

Oct 19, 2008 12:47 PM in response to orangekay

orangekay wrote:
StandardAlert still wasn't a symbol exported by the Appearance Manager library as far as I can recall. What else ya got?


Apple documentation on the StandardAlert that says "This function is available with Appearance Manager 1.0 and later."

Oh right, I forgot that none of these products work anymore--probably because I've actually used them, but we can't let that count for much.


No we can't. I'm just repeating what I remember about complaints when Apple released Leopard that the "Pro" apps wouldn't work on Leopard. They do now, from what I hear. I wouldn't know because I've never used them. I'm a professional software developer by trade. Don't ask me about video editing, because I know nothing about. But I daresay I know more about software development than "some" 🙂

Your Carbon malignment crusade would be a lot more convincing if you were able to express your extraordinarily skewed opinions of it in such a way as to indicate that you had actually used the library--or any of its predecessors--in some meaningful capacity.


Telling people to avoid libraries that Apple has already stopped supporting in the 64-bit architecture is "malignment" and "extraordinarily skewed"? Just calm down! Like it or not, Carbon is on its way out. I always prefer to use relatively new, stable libraries when I have the choice.

Now, to get back to the original poster's question. There is a pure Carbon "CreateStandardAlert" function that can be used with "RunStandardAlert". I expect they would work just fine. I am a little bit worried about the filter function on RunStandardAlert. The old MacOS-vintage code would typically lock up the system while modal dialogs were displayed and menus were being selected. You could avoid that by writing a clever filter function to process those events while you were in the modal loop. Given that the original application in question seems to be a digital media program, using these two Carbon functions could cause problems. I don't think they will, but you never know.

I think "NSRunAlertPanel" would be easier to use and easier to link with that 3rd party SDL library.

Feel free to get the last word in if you want, I've lost interest and I shan't reply to this thread.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

C++: MessageBox with MacosX?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.