Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Dumb it Down a little for me please!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="insinkerator" data-source="post: 704645" data-attributes="member: 62041"><p>Ok so here is my story. I am using the older model iMac G5 all in screen thing and am currently running leopard 10.5.2. Im not too sure if this is relevant but you never know!!</p><p></p><p>When it comes to computer programming i am a complete noob. I havent a clue what i am doing! So im trying to learn C++. Can you help?</p><p></p><p>I downloaded a tutorial that works through the compiler "bloodshed" but i am using Xcode 3.1 and this is where my problem is. So i open up Xcode. File > New Project > Carbon C++ Standard Application...</p><p></p><p>There is an attached picture of the window i am looking at. So i click on main.cp thinking that would make the most sense. And i get this</p><p></p><p>//</p><p>// main.cpp</p><p>// Untitled</p><p>//</p><p>// Created by Killian O'Connell on 06/08/2008.</p><p>// Copyright Carrigaline Community School 2008. All rights reserved.</p><p>//</p><p></p><p>#include <Carbon/Carbon.h></p><p>#include "TApplication.h"</p><p>#include "TWindow.h"</p><p></p><p>// Our custom application class</p><p>class CarbonApp : public TApplication</p><p>{</p><p> public:</p><p> </p><p> CarbonApp() {}</p><p> virtual ~CarbonApp() {}</p><p> </p><p> protected:</p><p> virtual Boolean HandleCommand( const HICommandExtended& inCommand );</p><p>};</p><p></p><p>// Our main window class</p><p>class MainWindow : public TWindow</p><p>{</p><p> public:</p><p> MainWindow() : TWindow( CFSTR("MainWindow") ) {}</p><p> virtual ~MainWindow() {}</p><p> </p><p> static void Create();</p><p> </p><p> protected:</p><p> virtual Boolean HandleCommand( const HICommandExtended& inCommand );</p><p>};</p><p></p><p>//--------------------------------------------------------------------------------------------</p><p>int main(int argc, char* argv[])</p><p>{</p><p> CarbonApp app;</p><p> </p><p> // Create a new window. A full-fledged application would do this from an AppleEvent handler</p><p> // for kAEOpenApplication.</p><p> MainWindow::Create();</p><p> </p><p> app.Run();</p><p> return 0;</p><p>}</p><p></p><p>//--------------------------------------------------------------------------------------------</p><p>Boolean</p><p>CarbonApp::HandleCommand( const HICommandExtended& inCommand )</p><p>{</p><p> switch ( inCommand.commandID )</p><p> {</p><p> case kHICommandNew:</p><p> MainWindow::Create();</p><p> return true;</p><p> </p><p> // Add your own command-handling cases here</p><p> </p><p> default:</p><p> return false;</p><p> }</p><p>}</p><p></p><p>//--------------------------------------------------------------------------------------------</p><p>void</p><p>MainWindow::Create()</p><p>{</p><p> MainWindow* wind = new MainWindow();</p><p></p><p> // Position new windows in a staggered arrangement on the main screen</p><p> RepositionWindow( *wind, NULL, kWindowCascadeOnMainScreen );</p><p> </p><p> // The window was created hidden, so show it</p><p> wind->Show();</p><p>}</p><p></p><p>//--------------------------------------------------------------------------------------------</p><p>Boolean</p><p>MainWindow::HandleCommand( const HICommandExtended& inCommand )</p><p>{</p><p> switch ( inCommand.commandID )</p><p> {</p><p> // Add your own command-handling cases here</p><p> </p><p> default:</p><p> return false;</p><p> }</p><p>}</p><p></p><p></p><p>now where the **** am i supposed to start writing code? Also I have no clue about any terminology so speak to me as if im like a 3 year old kid and i might understand you<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick out tongue :p" loading="lazy" data-shortname=":p" /></p></blockquote><p></p>
[QUOTE="insinkerator, post: 704645, member: 62041"] Ok so here is my story. I am using the older model iMac G5 all in screen thing and am currently running leopard 10.5.2. Im not too sure if this is relevant but you never know!! When it comes to computer programming i am a complete noob. I havent a clue what i am doing! So im trying to learn C++. Can you help? I downloaded a tutorial that works through the compiler "bloodshed" but i am using Xcode 3.1 and this is where my problem is. So i open up Xcode. File > New Project > Carbon C++ Standard Application... There is an attached picture of the window i am looking at. So i click on main.cp thinking that would make the most sense. And i get this // // main.cpp // Untitled // // Created by Killian O'Connell on 06/08/2008. // Copyright Carrigaline Community School 2008. All rights reserved. // #include <Carbon/Carbon.h> #include "TApplication.h" #include "TWindow.h" // Our custom application class class CarbonApp : public TApplication { public: CarbonApp() {} virtual ~CarbonApp() {} protected: virtual Boolean HandleCommand( const HICommandExtended& inCommand ); }; // Our main window class class MainWindow : public TWindow { public: MainWindow() : TWindow( CFSTR("MainWindow") ) {} virtual ~MainWindow() {} static void Create(); protected: virtual Boolean HandleCommand( const HICommandExtended& inCommand ); }; //-------------------------------------------------------------------------------------------- int main(int argc, char* argv[]) { CarbonApp app; // Create a new window. A full-fledged application would do this from an AppleEvent handler // for kAEOpenApplication. MainWindow::Create(); app.Run(); return 0; } //-------------------------------------------------------------------------------------------- Boolean CarbonApp::HandleCommand( const HICommandExtended& inCommand ) { switch ( inCommand.commandID ) { case kHICommandNew: MainWindow::Create(); return true; // Add your own command-handling cases here default: return false; } } //-------------------------------------------------------------------------------------------- void MainWindow::Create() { MainWindow* wind = new MainWindow(); // Position new windows in a staggered arrangement on the main screen RepositionWindow( *wind, NULL, kWindowCascadeOnMainScreen ); // The window was created hidden, so show it wind->Show(); } //-------------------------------------------------------------------------------------------- Boolean MainWindow::HandleCommand( const HICommandExtended& inCommand ) { switch ( inCommand.commandID ) { // Add your own command-handling cases here default: return false; } } now where the **** am i supposed to start writing code? Also I have no clue about any terminology so speak to me as if im like a 3 year old kid and i might understand you:P [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Dumb it Down a little for me please!
Top