[comp.sys.apple] More GS Source Examples??

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") (04/13/89)

I've been writing a program (in assembler) that needs a window with the
data height greater than $FFFF.   Is there any way to stuff everything
into the window??

Also, I've been wondering about some tricks to do with the Menu Manager.
How would you code:
    Hierarchical menus,
    Tear off menus,
and Menus inside a window??

-Gonzo

keith@Apple.COM (Keith Rollin) (04/13/89)

In article <8904121453.aa15335@SMOKE.BRL.MIL> JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:
>
>I've been writing a program (in assembler) that needs a window with the
>data height greater than $FFFF.   Is there any way to stuff everything
>into the window??

There *ARE* ways, but I can't think of any easy ones. The only one that I
would try doing is the same way that MacApp does it on the Macintosh; store
your position within your data as a longint in your own data structures. Then
translate it into some 16-bit value by taking the top 16 significant bits and
using it for your coordinates and scrollbar values.

>Also, I've been wondering about some tricks to do with the Menu Manager.
>How would you code:
>    Hierarchical menus,
>    Tear off menus,
>and Menus inside a window??
>

Of these three, I've only seen the last one implemented on a GS. It is covered
in Apple IIGS Technote #3. Actually, that technote discusses the more specific
instance where one might want to install a menubar in a window's infobar, but
the technique is easily adapted to other cases.

Hierarchical and TearOff menus cannot be implemented without some serious
re-programming. There are no tricks that I am aware to implement these.


------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc.  ---  Developer Technical Support
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions

krazy@claris.com (Jeff Erickson) (04/13/89)

From article <28874@apple.Apple.COM>, by keith@Apple.COM (Keith Rollin):
> In article <8904121453.aa15335@SMOKE.BRL.MIL> JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:
>>
>>I've been writing a program (in assembler) that needs a window with the
>>data height greater than $FFFF.   Is there any way to stuff everything
>>into the window??
> 
> There *ARE* ways, but I can't think of any easy ones. The only one that I
> would try doing is the same way that MacApp does it on the Macintosh; store
> your position within your data as a longint in your own data structures. Then
> translate it into some 16-bit value by taking the top 16 significant bits and
> using it for your coordinates and scrollbar values.
>
The biggest problem if you let TaskMaster do your scrolling is that you have
to infer the scrollbar positions from the origin when TM calls your window's
update routine.  If you're using a data area larger thatn 65535, you have
to translate this into your REAL origin INTERNALLY (since QuickDraw space
isn't that big!) before drawing.  Needless to say, this can get really hairy.

I would suggest that you NOT use TM's scrollbars.  It's a little more work
to keep track of the controls yourself, but you end up with MUCH more control
over their behavior.  (This is the approach we used in AWGS; none of the
modules use TM scrollbars or grow boxes.)

-- 
Jeff Erickson     \  Internet: krazy@claris.com          AppleLink: Erickson4
Claris Corporation \      UUCP: {ames,apple,portal,sun,voder}!claris!krazy
415/960-2693        \________________________________________________________
Soon: 408/987-7309  /        "I'm so heppy I'm mizzabil!" -- Krazy Kat