[comp.sys.atari.st.tech] MWC & hiding objects in resources

sean@ccwf.cc.utexas.edu (Sean Sterling Foiles) (04/18/91)

I'm having trouble hiding objects within a resourcce.  I've tried
changing the object's flag (i.e. obj.ob_flag = HIDETREE) and redrawing
the tree - but no go.  I can do anything else (make selectable, crossed,
deselected, etc...) but I can't hide the object.

I'm sure this is possible (the Resource Construction Kit allows it).
Also, when I decompile a resource containing both hidden and unhidden
objects (using the resdecomp) the listing states those objects that
were hidden with the entry "OPTION: hidden".  And when I execute the
resource, sure enough, the objects with "OPTION: hidden" are hidden 
and those without are displayed.

Any suggestions?

Thanks,
 Sean Sterling Foiles  / Univ. Texas Comp Sci Grad / sean@happy.cc.utexas.edu 

marc@sequoia.cray.com (Marc Bouron) (04/18/91)

In article <47391@ut-emx.uucp>, sean@ccwf.cc.utexas.edu (Sean Sterling Foiles) writes:
|> I'm having trouble hiding objects within a resourcce.  I've tried
|> changing the object's flag (i.e. obj.ob_flag = HIDETREE) and redrawing
|> the tree - but no go.  I can do anything else (make selectable, crossed,
|> deselected, etc...) but I can't hide the object.

I believe that the HIDETREE flag should be set for the *parent* of the object
you wish to hide.

[M][a][r][c]


################################################################################
#                           #  marc@sequoia.cray.com           #     .   .     #
#  Marc CR Bouron           #  M.Bouron@cray.co.uk     (ARPA)  #    _|\ /|_    #
#  Cray Research (UK) Ltd.  #  M.Bouron@crayuk.uucp  (DOMAIN)  #   (_|_V_|_)   #
#  +44 344 485971 x2208     #  M.Bouron@uk.co.cray    (JANET)  #     |   |     #
#                           #  ...!ukc!crayuk!M.Bouron (UUCP)  #               #
################################################################################

woodside@ttidca.TTI.COM (George Woodside) (04/22/91)

In article <093029.24377@timbuk.cray.com> marc@sequoia.cray.com (Marc Bouron) writes:
>
>In article <47391@ut-emx.uucp>, sean@ccwf.cc.utexas.edu (Sean Sterling Foiles) writes:
>|> I'm having trouble hiding objects within a resourcce.  I've tried
>|> changing the object's flag (i.e. obj.ob_flag = HIDETREE) and redrawing
>|> the tree - but no go.  I can do anything else (make selectable, crossed,
>|> deselected, etc...) but I can't hide the object.
>
>I believe that the HIDETREE flag should be set for the *parent* of the object
>you wish to hide.

No. You hide the object by setting the HIDETREE flag bit on the object you
wish to hide, but you must then redraw the parent of the object being hidden.

This actually makes sense, once you think about it. When an object is
hidden, it is ignored by the object drawing routines. If you draw an object,
then set the HIDETREE bit, and redraw it, it gets ignored. This means that
it still appears to be on the display, since there was no visible change.

If you redraw the parent of the object, it replaces the old image. Then, since
the hidden object gets ignored, the portion of the parent which is "behind"
the hidden object continues to be visible on the display.

-- 
* George R. Woodside - Citicorp/TTI - Santa Monica, CA *
* Path:       woodside@ttidca.tti.com                  *
*   or:       ..!{philabs|csun|psivax}!ttidca!woodside *