Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

Archive for April, 2010

Alternative Action and Send Functions

Does anyone have any experience with setting up
Alternative Action and Alternative Send
functions for handeling AppleEvents with the
OSA scripting interface? I can’t seem to get mine to
work. Here’s what I’ve got for a send…

OSErr MyAESendProc(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc, long refCon)
{
        OSErr myErr;
        OSASendProcPtr  yourProc;

        myErr = AESend(theAppleEvent, reply, sendMode, sendPriority, timeOutInTicks, idleProc, filterProc);

        return myErr;

}

It’s simple and, as far as I know, it should behave exactly
like the default function. Any ideas?

Desparate,
Travis
Travis_Peck…@together.org

.
posted by admin in Uncategorized and have No Comments

Q: List Manager vs. Grow Icon?

        Hello csmp!

        I need csmp.help again.

        I have a zoom/grow/close-able window that I created using
        NewCWindow that I would like to place a standard list in. I want
        the list to fill the entire window, have a single column, be
        initially empty, allow only one selection, and leave room for
        the grow icon in the window.

        All of this works fine EXCEPT the part about leaving room for the
        grow icon.

        I have tried the hasGrow parameter in the LNew procedure as both
        true and false. Neither seems to do anything. I looked through
        the internal data structures for a list and there does not seem
        to even be a place to store this information.

        Q1: Am I wrong to think that the hasGrow parameter specifies
        that the window the list appears in has a grow icon and the list
        should leave room for it?

        Q2: If I am wrong, what does the hasGrow parameter in the LNew
        call do?

        Q3: Where is the hasGrow information stored by the List Manager?

        Q4: Is there any way to do what I want without resorting to
        installing my own scroll bar (it sure would be nice to have the
        List Manager take care of it for me)?

        I am developing this on a Macintosh IIcx running System 7.5. I
        am using Think C 7.0.4 (Universal Headers)

        #define kDrawOnChange true
        #define kHasGrow true
        #define kNoScrollHoriz false
        #define kScrollVert true
        #define kScrollBarOffset 15

        ListHandle NewListForWindow(WindowPtr aWindow) {
           ListHandle theList = nil;
           Point theCellSize = {0, 0}; /* Let List Manager calculate */
           Rect theListSize = {0, 0, 1, 0}; /* One column, no rows */
           Rect theListRect;

           if (aWindow != nil) {
              theListRect = aWindow->portRect; /* List fills window */
              theListRect.right -= kScrollBarOffset; /* Room for scroll bar */
              theList = LNew(&theListRect, &theListSize, theCellSize, 0,
                 aWindow, kDrawOnChange, kHasGrow, kNoScrollHoriz, kScrollVert);
              if (theList != nil) {
                 (**theList).selFlags |= lOnlyOne; /* Select on at a time */
              }
           }
           return theList;
        }


Hope you can help.

Mark H. Linton
____________________________________________________________________
mark \’märk\ n [ME, fr. OE mearc boundary, march, sign; akin to OHG
marha boundary, L margo] 1 a : a conspicuous object serving as a guide
for travelers 2 : A standard or criterion of quality 3 : An object or
point that serves as a guide –idiom. mark time. 1 : To make little or
no progress

posted by admin in Uncategorized and have Comments (3)

[Q]:TE Custom Hook

Does anyone have an information what "TE Custom Hook" is ?

I’d like to know what I should refer; which volume of Inside Macintosh
series or so ?

Thanks in advance.

Kouji Tsurumaki
Internet: ts…@aether.hil.ntt.jp
Telephone +81-468-59-2967
Fax.      +81-468-59-2332

posted by admin in Uncategorized and have No Comments

Make a file into a folder?

I have a unix file that should be a folder on my mac but is shows up as
file (ttxt)… is there any way to tweak it into being a folder with
RedEdit or something?

Frank

posted by admin in Uncategorized and have Comments (3)

More CopyBits/flight sim stuff…

   Whats the best way to update the ‘screen’ area of a craft
without disturbing the cockpit/maximizing screen redraw speed?
CopyBits with a maskRgn? CopyMask?
What are the speed conciderations/ease of implimentation?

   Also, does CopBits, ect. skip the scaling process when
the source and dest. rects are the same size?  Seems like
thing run a lot faster at 1:1 than at, say 1:.8
Things also seem faster again at a 1:2 ratio..is CopyBits
pixel-doubling at 1:2 instead of scaling?

Nathanael Henderson    *Worried about loosing your hair?
                       *Never go Bald!!!!   Age-old treatment
                       *rediscovered!  Results or your money
                       *back!  (e-mail for details….)

posted by admin in Uncategorized and have Comments (3)

Q: Calling DisposDialog from a function with a pointer

Hi.

I’m just getting into Mac programming and my understanding of pointers isn’t
too good. Can anyone tell me why the following doesn’t work: I have created a
window in main with GetNewDialog like this

   editWindow = GetNewDialog (128, nil, (WindowPtr) -1);  

when I want to close the window, I call a function doCloseCharacter as follows:

   doCloseCharacter (&editWindow);

where the doCloseCharacter function looks like this:

   void doCloseCharacter (DialogPtr *theWindow)

   {  
      DisposDialog (*theWindow);
   }

(needless to say I’ve cut out the unimportant details). This doesn’t seem to
have any effect.

Any help on this would be much appreciated.
Thanks.

Richard Drysdall                                |
University of Waikato                           |   "I’m called a theoretical
Hamilton, New Zealand                           |    physicist because in
drysd…@waikato.ac.nz                         |    practice I’m not"

posted by admin in Uncategorized and have Comments (2)

Q: Source for an 'idea' event loop?

I was wondering if there is such a thing as an ‘ideal’ event loop, that is, one
that contains code for all possible eventualities for a simplish program that
has multiple non-modal dialogs. I’m writing my own based on what I can gleen
from THINK Reference, but it’s pretty tough going for a beginner! If someone
could direct me to a source, I’d be very grateful.

Thanks.

Richard Drysdall                                |
University of Waikato                           |   "I’m called a theoretical
Hamilton, New Zealand                           |    physicist because in
drysd…@waikato.ac.nz                         |    practice I’m not"

posted by admin in Uncategorized and have No Comments

Q: Mistakes in THINK Reference SFGetFile example code?

I’m been trying to get the example code for the SFGetFile in THINK Reference
going (that’s the one that filters out all documents except file of type ‘TEXT’
which have been created in the last 30 days). I found the bug where they’ve
written &typeList instead of typeList, and corrected this in my code, but my
program still doesn’t go – Symantec C++ complains that the third parameter does
not match the prototype (that’s oldFileFilter, declared as

     pascal Boolean oldFileFilter (FileParam *thePB)

Can anyone help me out? Incidentally, if anyone has documented any of the other
bugs in the THINK Reference code examples, I’d be grateful to know of a source
for them too.

Thanks very much for any help.

Richard Drysdall                                |
University of Waikato                           |   "I’m called a theoretical
Hamilton, New Zealand                           |    physicist because in
drysd…@waikato.ac.nz                         |    practice I’m not"

posted by admin in Uncategorized and have Comment (1)

[Q] CTB & Appletalk ADSP

     I’m working on a simple app that uses the CTB.  I’d like to use it
on the same Mac as my First Class server, and be able to log into the
server (e.g. my IIvx is running the FC server, and I’d like to use my app
on the IIvx *and* log into one of the server’s CLUI sessions).

     There’s just one problem, it won’t connect.  I’ve used SITcomm and
have been able to connect just fine, no problems at all.  When I try
*anything* else (Surfer, my application, and anything else I could find
that uses the CTB) the connection is never made.  I’ve used the same
setup in the other applications that I’ve used with SITcomm for both the
connection and terminal emulation (obviously the terminal emulation isn’t
too important, but I tried to be consistent).  BTW, using these apps on a
second Mac which is networked to the IIvx works fine, all the apps will
connect with no problems.

     So, the question is this:  What is my application missing?  What
is SITcomm doing that is allowing this connection to go through while my
app sits there?  Any help is appreciated…. :)


"Chuck Norris for the defense eh?"
Eric A. Drumbor
BW Software                                            
er…@netcom.com
formerly Malicious_Mona…@nile.com

posted by admin in Uncategorized and have No Comments

CopyBits/OffScreenGWorlds

    How do you get copyBits to use an off-screen Gworld’s pixmap
as it’s source bitmap?  (or, how do you access it’s base address?)
Copying random chunks of memory to the screen is interesting,
but not all that usefull.  :-)

Nathanael Henderson    *Worried about loosing your hair?
                       *Never go Bald!!!!   Age-old treatment
                       *rediscovered!  Results or your money
                       *back!  (e-mail for details….)

posted by admin in Uncategorized and have Comment (1)