Professional Web Applications Themes

learning carbon event handlers - Mac Programming

I have been programming Macs for a long time and I'm pretty confident in my basic Mac programming ability. However, my Carbon apps are still using the old WaitNextEvent loop, doing a switch on the "what" member of an EventRecord, and handling events that way. I would really like to learn how to skeletonized a basic Carbon handling app: how to install the various handlers, what the main body of the program looks like (I think it's just a call to RunApplicationEventLoop) and how to finalized stuff. Apple's dev site has a long description of the basic theory of Carbon ...

  1. #1

    Default learning carbon event handlers

    I have been programming Macs for a long time and I'm pretty confident in
    my basic Mac programming ability. However, my Carbon apps are still using
    the old WaitNextEvent loop, doing a switch on the "what" member of an
    EventRecord, and handling events that way.

    I would really like to learn how to skeletonized a basic Carbon handling
    app: how to install the various handlers, what the main body of the
    program looks like (I think it's just a call to RunApplicationEventLoop)
    and how to finalized stuff.

    Apple's dev site has a long description of the basic theory of Carbon
    events, starting at
    http://developer.apple.com/doentation/Carbon/Conceptual/Carbon_Event_Manager/Intro/index.html
    but I would like to find a stupid little sample program that just sets up
    the event handlers, enters the main loop, cleans up afterwards, and
    exits.

    Is there such a demostration? I can't find anything like this in the
    sample code on Apple's website, and I don't know if I can infer how to
    build this kind of structure based on loose descriptions alone.

    Any help is truly appreciated. Thank you very much.

    __________________________________________________ ______________________
    Keith Wiley unm.edu
    http://www.unm.edu/~keithw http://www.mp3.com/KeithWiley

    "Yet mark his perfect self-contentment, and hence learn his lesson,
    that to be self-contented is to be vile and ignorant, and that to
    aspire is better than to be blindly and impotently happy."
    -- Edwin A. Abbott, Flatland
    __________________________________________________ ______________________
    Keith Guest

  2. #2

    Default Re: learning carbon event handlers

    In article <cs.unm.edu>,
    Keith Wiley <unm.edu> wrote:
     

    The main "loop" is just a single call to RunApplicationEventLoop() and
    there's nothing to clean up, so you don't have to worry about any of
    that. You just have to figure out how to install them, but that's
    actually pretty easy. Honestly. :)
     

    Take a look at /Developer/Examples/Carbon on Mac OS X. There are a
    bunch of simple Carbon-event-using examples there. CarbonToolbar is a
    good one, I think.

    -Eric

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

  3. #3

    Default Re: learning carbon event handlers

    Eric:
    I tried looking at CarbonToolbar but got an error saying that it was made
    with a newer version of Project Builder (mine is 2.0). When I tried
    compiling it anyway, it complained that the headers were version 24 not 25.

    I'm using Panther 10.3.1 and have installed Xcode files and the Xcode
    update, though I'm not sure additional Developer stuff was installed when I
    installed Panther... in any case I kept up with the ADC Developer updates.
    Any hints on this?

    TIA 

    brucecoughlin Guest

  4. #4

    Default Re: learning carbon event handlers

    If you're running Panther, you shouldn't still have Project Builder
    around. It might be around if you didn't do a clean install of Panther.
    If so, run 'sudo perl /Developer/Tools/uninstall-devtools.pl' from the
    command line to uninstall your developer tools and then install the
    Panther developer tools again.

    If you still have Project Builder installed after all of that, just
    delete it. :) PB 2.0 is definitely not supported on Panther.

    -Eric

    In article <BBDC4556.4818%rr.com>,
    brucecoughlin <rr.com> wrote:
     
    >[/ref]

    --
    Eric Albert edu
    http://rescomp.stanford.edu/~ejalbert/
    Eric Guest

Similar Threads

  1. are there any event handlers besides onClick?
    By Byron Adams in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: January 16th, 09:48 AM
  2. Missing Event Handlers
    By Carol Braileanu in forum ASP.NET Building Controls
    Replies: 0
    Last Post: October 11th, 01:32 PM
  3. event handlers
    By shadow1960 in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: February 9th, 05:43 AM
  4. Losing event handlers
    By Matt Sogla in forum ASP.NET General
    Replies: 1
    Last Post: July 31st, 04:41 PM
  5. crazy event handlers!
    By Trevor Hartman in forum ASP.NET General
    Replies: 2
    Last Post: June 26th, 01:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139