 |
 |
mac gui creation
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status:
Offline
|
|
hey, i switched to mac a little while ago(bout a year actually) but i've been writing some programs in c++ and c and wondering if yall knew any good links for building gui's for c and c++ programs on mac os x. any suggestions would be helpful, except the ones that say learn cocoa i know cocoa is the way to go right now but i need to build some gui's for programs i've already written. thx in advance.
Mafia
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status:
Offline
|
|
What is preventing you from using Cocoa to build the GUIs? It's compatible with C and C++.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status:
Offline
|
|
is it really? all the resources i've found have meant cocoa code with interface builder do u have any references or anything on how to implement interface builder with c and c++
mafia
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: Up north
Status:
Offline
|
|
i think he means use cocoa and obj-c for the interface builder code. the rest can be c++ or c. just have the obj-c pass off things...
Obj-c is trivial to pick up if already know c, c++ and understand object oriented programming. Trying to control the interface builder stuff with c++ is not the way to go. Use obj-c for that.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status:
Offline
|
|
ya maybe i'm retardo but i'm just trying to learn so please excuse my elementry questions, how exactly woudl u do this i mean with a cocoa project and include the .cpp file? i dunno plz enlighten me to your knowledge.
mafia
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by Mafia:
ya maybe i'm retardo but i'm just trying to learn so please excuse my elementry questions, how exactly woudl u do this i mean with a cocoa project and include the .cpp file? i dunno plz enlighten me to your knowledge.
mafia
It's called Objective-C++. I means you can mix C++ and Objective-C code in the same file, so you can have the Objective-C stuff hooked up to an interface builder file, and call C++ code from the Objective-C code.
an example:
Code:
- (void) mouseDown:(NSEvent *)e
{
someC++Object.doSomething;
[someObjectiveCObject doSomethingElse];
}
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status:
Offline
|
|
ok i'm starting to understand i want to again thank you for all your help, ok say i want to write a program to take user input look for the input in a txt file and display it, i build interface extract controller files, now what exactly would i type in main.m? anything or would all the coding be done in the controllers, or would i like do the read from blah.txt in the main this is where i'm really confused.
mafia
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Status:
Offline
|
|
Originally posted by Mafia:
ok i'm starting to understand i want to again thank you for all your help, ok say i want to write a program to take user input look for the input in a txt file and display it, i build interface extract controller files, now what exactly would i type in main.m? anything or would all the coding be done in the controllers, or would i like do the read from blah.txt in the main this is where i'm really confused.
mafia
main() is not used much in Cocoa programs. For a program that simple, I'd have a class that had an NSTextView (created in Interface Builder) and an NSString for the contents of the file (created with [NSString stringWithContentsOfFile:]  . Then NSScanner (I think) should have everything you need for doing the text search.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status:
Offline
|
|
thx for the replies cat, i'm really getting a hang of this.
mafia
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status:
Offline
|
|
Just to be clear about this, main() is used extensively, but it is inside the AppKit Framework that you link to (already done for you in XCode/ProjectBuilder Applications). The framework handles all the run-loop management for you, and you concentrate on building your applications functional code.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|