The best guide for this is Matt's book, chapter 32. It goes into detail and
goes over a number of examples. Here's a couple of things to keep in mind:
-I see people taking the long way around this one all the time. If the call
needs an OSType, which is a four character string encoded as a series of
shorts, just pass a REALbasic String, instead of creating a MemoryBlock and
populating it with the values. REALbasic will take care of it for you.
-REALbasic can be very annoying when it comes to toolbox calls that don't
return a value. It's easier to declare it as returning an Integer. It
won't hurt anything, and it makes it easier to call.
-When calling a Toolbox call that draws an image to any graphics surface,
call G.ClearRect(0,0,0,0), where G is the graphics object that you want to
draw to. This will force REALbasic to internally switch the current "focus"
to the place you want to draw to.
-If a toolbox call takes an inPrevInfo (or similar) parameter, this is for
drawing any animations that the system might want to draw. You need to save
the inDrawInfo (or similar) prarmeter, and pass that as the inPrevInfo
parameter the next time you call it. An example of when this is used is
with Disclosure Triangles, where it draws an intermediate image when it
turns.
-And, of course, the best way to learn toolbox calls is to look at plenty of
examples and tinker with them.
Good luck,
-Mike
on 2/6/02 8:26 PM, Jarvis Badgley at chiper at macatawa dot org wrote:
> Are there any guides online about using declare statements,
> specifically how to read the API docs and knowing what
> memoryblock values to use? I'd like to learn how to use the
> various Appearance Manager drawing calls, but I don't know how
> to format most of the instruction blocks for the calls.
>
>
> ---
> Subscribe to the digest:
> <mailto:realbasic-nug-digest at lists dot realsoftware dot com>
> Unsubscribe:
> <mailto:realbasic-nug-off at lists dot realsoftware dot com>
|