jotokun Posted November 15, 2007 Share Posted November 15, 2007 I am learning C++ and would like to use my hackintosh to do so. However, due to me being new to the mac and Carbon(Came from Visual Studio on windows), I cant figure out how to talk to the .nib files. How do I do this? Say, for example, I had a button and a textbox. How would I go about making text appear in the textbox when I click the button? I am using Xcode 3.0 on Leopard Link to comment https://www.insanelymac.com/forum/topic/71420-carbon-gui-help/ Share on other sites More sharing options...
socal swimmer Posted November 17, 2007 Share Posted November 17, 2007 I would go with cocoa, not carbon. Well i actually don't know much about carbon, but it seems that cocoa is the preffered method. Here is how you do it. If you have a class called Lesson02Controller that controls the application: /* Lesson02Controller.h */ #import "LAController.h" @interface LAController: NSResponder { IBOutlet id textBox; // this is an outlet (text box, window, anything that you output data to) //... more instance variables } - (IBAction)nameOfButton:(id)sender; /* this method (function, really) gets called when that button gets pressed */ under interface builder: you go to Classes (in the top bar) -> Read Files, and pick LAController.h then in the window, you find LAController (under classes), and go to Classes (top bar) -> instantiate then in the window, under instances, you click on LAController, and go to Tools (top bar) -> Show inspector. the inspector window pops up. then control-click on LAController, and drag to an outlet. the inspector window will let you pick which outlet it is. Once you do that for all outlets, do the same going from buttons to the controller (in that direction) and in the inspector window, click to target/action, and choose which one. hope that helps for something better (ie tutorials, that are incredibly helpful, go to http://www.macdevcenter.com/pub/ct/37 and start from teh bottom, go up. it tells you everything with step by step. very good) Link to comment https://www.insanelymac.com/forum/topic/71420-carbon-gui-help/#findComment-509003 Share on other sites More sharing options...
Recommended Posts