Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > mac gui creation

mac gui creation
Thread Tools
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status: Offline
Reply With Quote
Jan 28, 2004, 03:54 PM
 
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
Reply With Quote
Jan 28, 2004, 05:40 PM
 
What is preventing you from using Cocoa to build the GUIs? It's compatible with C and C++.
     
Mafia  (op)
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status: Offline
Reply With Quote
Jan 28, 2004, 06:49 PM
 
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
Reply With Quote
Jan 28, 2004, 07:00 PM
 
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.
     
Mafia  (op)
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status: Offline
Reply With Quote
Jan 28, 2004, 07:52 PM
 
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
Reply With Quote
Jan 28, 2004, 08:25 PM
 
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]; }
     
Mafia  (op)
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status: Offline
Reply With Quote
Jan 28, 2004, 10:27 PM
 
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
Reply With Quote
Jan 28, 2004, 10:58 PM
 
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.
     
Mafia  (op)
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status: Offline
Reply With Quote
Jan 28, 2004, 11:37 PM
 
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
Reply With Quote
Jan 29, 2004, 11:24 AM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:54 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2