[comp.sys.mac.hypercard] How to visually "disable" a button?

jacks@pogo.WV.TEK.COM (Jack Slingerland) (04/27/91)

I am using HyperCard 2.0v2.  I want to "gray out" some buttons when they
are not appropriate.  I could make a separate icon that shows gray to
use when the button is not available and then hiding one icon and showing
the other.  This seems unnecessarily heavy-handed.

Does HyperCard provide something analagous to "disable" (which works for
menus) to use with buttons?
	--- Jack

johnston@oscar.ccm.udel.edu (05/01/91)

In article <10793@pogo.WV.TEK.COM>, jacks@pogo.WV.TEK.COM (Jack Slingerland) writes...
> 
>I am using HyperCard 2.0v2.  I want to "gray out" some buttons when they
>are not appropriate.  I could make a separate icon that shows gray to
>use when the button is not available and then hiding one icon and showing
>the other.  This seems unnecessarily heavy-handed.

In HC 2, you can say "set the icon of btn btnName to iconName" -- no need
to show or hide anything.  As far as creating greyed out buttons, the
ResEdit paint can tool works wonders -- much better than FatBits editing.
Icons only take up 128 bytes; the effect on stack size is small compared 
to creating buttons or fields.   -- Bill (johnston@minnie.me.udel.edu) 

sumner@opusc.csd.scarolina.edu (David Sumner) (05/02/91)

I believe there is a disable font available somewhere, too.
(I have it on my machine so I know it exists!)
I think it was made by someone at Apple so maybe it is
available at Apple.com.
 
David Sumner

leue@galen.crd.ge.com (Bill Leue) (05/02/91)

In article <10793@pogo.WV.TEK.COM> jacks@pogo.WV.TEK.COM (Jack Slingerland) writes:
>
>I am using HyperCard 2.0v2.  I want to "gray out" some buttons when they
>are not appropriate.  I could make a separate icon that shows gray to
>use when the button is not available and then hiding one icon and showing
>the other.  This seems unnecessarily heavy-handed.
>
Perhaps so.  I use another, perhaps equally clumsy method:  After
creating my buttons, sizing them, iconizing them, etc., I snapshot
the screen, extract just the button images from the dump, turn the
black parts to gray with the paint bucket in SuperPaint, and then import
the result back into HC via the cliboard, and paste the bitmap back
"under" the buttons.  When I want to gray out a button, I just hide it,
and the greyed-out bitmap under the button then shows through.  This
technique requires a bit of munging around to set up, but once you have
done it, all it takes is "hide" and "show" commands to grey-out and
restore the button.

-Bill Leue
leue@crd.ge.com

weiss@watson.seas.ucla.edu (Michael Weiss) (05/03/91)

In article <10793@pogo.WV.TEK.COM> jacks@pogo.WV.TEK.COM (Jack Slingerland) writes:
>I am using HyperCard 2.0v2.  I want to "gray out" some buttons when they
>are not appropriate.  I could make a separate icon that shows gray to
>use when the button is not available and then hiding one icon and showing
>the other.  This seems unnecessarily heavy-handed.

I did a little trick that gives the illusion of grayed buttons.  Underneath
the button, I have a picture of the button, which I have colored grey.  When
I want to "grey out" the button, I simply hide it, exposing the "fake"
button below (the one I colored in grey).  When the button needs to reappear,
I simply show it.
--
\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /
-  Michael Weiss  weiss@watson.seas.ucla.edu  |  School of Engineering and  -
-                 izzydp5@oac.ucla.edu        |    Applied Science, UCLA    -
/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \ 

kik@wjh12.harvard.edu (Ken Kreshtool) (05/05/91)

Note that the icon editor in HC 2.x makes it pretty easy to "gray" an icon.  So
you might create a second button with a grayed image of the first, and, as
others have posted, hide the first button and show the grayed one.

To create the grayed icon, create a copy of the real button to serve as the
disabled one (and change its script appropriately).  Get your way to the dialog
where you assign icons, and choose to Edit... this one's icon. This opens up
the icon editor.  In the File menu, choose "Duplicate Icon" and in the Special
menu, choose "Gray".  If you like what you see, you're done!  (Sometimes you
need to do some touching up.)

You should duplicate before graying; otherwise the original icon gets grayed,
and so appears on both the old and the new buttons.

An advantage to using a button over a picture (I use both) is that you can
write a script for the disabled button, for example to throw up an "answer"
dialog.  Once in a while this is warranted.

Ken Kreshtool
kik@wjh12.harvard.edu

dmittman@beowulf.JPL.NASA.GOV (David Mittman) (05/07/91)

There is font named "Chicago Hollow" which is a grey version of
Chicago. You can find it in the Sumex archives.

					- David

leue@galen.crd.ge.com (Bill Leue) (05/07/91)

In article <1991May6.190728.4759@jpl-devvax.jpl.nasa.gov> dmittman@beowulf.JPL.NASA.GOV (David Mittman) writes:
>There is font named "Chicago Hollow" which is a grey version of
>Chicago. You can find it in the Sumex archives.
>
True.  One thing that the "icon" technique won't handle is large
buttons, since an icon can only be so big.  For really large, non-transparent
buttons, the only approach that works is the "image" approach.

-Bill Leue
leue@crd.ge.com

man@cs.brown.edu (Mark H. Nodine) (05/08/91)

|> In article <1991May6.190728.4759@jpl-devvax.jpl.nasa.gov> dmittman@beowulf.JPL.NASA.GOV (David Mittman) writes:
|>There is font named "Chicago Hollow" which is a grey version of
|>Chicago. You can find it in the Sumex archives.

Are you sure?  What's it called?  I just looked for it and didn't find it.

	--Mark

ralph@world.std.com (Ralph Lombreglia) (05/10/91)

>turning HyperCard buttons gray

Somebody must have said this by now, but HyperCard 2's built-in icon
editor has a menu command for turning icons gray.  You'd simply make a
copy of the desired icon, gray it, and then "set" your button to that
icon when you wanted it to be grayed-out.

Ralph Lombreglia
----------------
ralph@world.std.com
MCI Mail & BIX: rlombreglia