%%HP: T(3)A(D)F(.);
@
@ HP49G Version S.Lui 9/25/01
@ Busy Signal Display Routine  10/18/98 stan Lui
@ Standard Input :  c cg
@         c - Control routine function
@              0 : display the busy signal graphic, and  return the 
@                   underneath graphic in a grob
@              grob : replace the graphic area with the graphic grob
@         cg - Choose graphic to display for the busy signal
@              0 : Hourglass
@              1 : Clock
@
@ Smart (tm) Input:  pos c cg
@ This routine will detect if a third parameter (pos) exists in the stack
@ pos is a list of two elements: eg, {#23d #43d} which specifies the position
@ to use to display the grob.
@ caution: to avoid error, if standard input is used, ensure that the pos parameter
@ is not in the stack.
@
\<< 
0 {} 0 \-> c cg    g pos p \<<
 
    IF DEPTH THEN
       'p' STO p
       IF p TYPE 5 == THEN
          IF p SIZE 2 == THEN
             IF p 1 GET TYPE 10 == p 2 GET TYPE 10 == AND THEN
                'pos' STO
             END
          END
       END
    END

    PICT IF pos {} == THEN { # 7Ah # 36h } ELSE pos END

    IF c 0 SAME THEN
       DUP2 { # 83h # 3Fh } SUB 'g' STO
       CASE
           cg 0 == THEN  HGLS  END
           cg 1 == THEN  CLOCK1  END
           cg 2 == THEN  CLOCK2  END
           cg 3 == THEN  CLOCK3  END
           cg 4 == THEN  CLOCK4  END
       END
       REPL 
       g
    ELSE
       c REPL
    END
    
\>> \>>




