[comp.sys.handhelds] Putting GROB's into the menu keys

ahernsd@mentor.cc.purdue.edu (Dynastar) (04/03/91)

I heard on this newsgroup that it is possible to create
an appropriatly sized GROB and place it into the CST
variable to create incredibly customized menu keys.

Well, when I read this, I had just gotten my 48sx, so
I had little or no idea what the post was talking about.

Now that I have a need of such a function (I want to put
gradient of g on a key.  upside-down delta - g ), I wish
that I had saved the posting.

Can anyone provide insight about this?

Thanks for the help!

-- 
Sean Ahern ----------- Purdue University --------- ahernsd@mentor.cc.purdue.edu
Dan Quayle: "Japan is an important ally of ours.  Japan and the United States
             of the Western industrialized capacity, 60 percent of the GNP,
  :-)        two countries.  That's a statement in and of itself."

cloos@acsu.buffalo.edu (James H. Cloos) (04/04/91)

In article <9393@mentor.cc.purdue.edu> ahernsd@mentor.cc.purdue.edu (Dynastar) writes:
>I heard on this newsgroup that it is possible to create
>an appropriatly sized GROB and place it into the CST
>variable to create incredibly customized menu keys.
>
>Well, when I read this, I had just gotten my 48sx, so
>I had little or no idea what the post was talking about.
>
>Now that I have a need of such a function (I want to put
>gradient of g on a key.  upside-down delta - g ), I wish
>that I had saved the posting.
>
>Can anyone provide insight about this?
>
>Thanks for the help!
>

[I'll attempt to make a tutorial out of this:  it can be edited and added
to the FAQ when it--eventually--gets put together.]

To begin with, familiarize yourself with the sections of chaper 15 of the
Owner's Manual that deal with custom menus.  Note that a string can be used
to lable the key.  For the purposes of the GROB discussion, lets define an
example.  the list  { { "123" { 1 2 3 } } FRED { "WIL" a b c } }
creates a menu with the lables [123], [FRED], and [WIL].  Hitting [123]
puts a 1 on the stack, left-shift-[123] puts a 2, and right-shift[123] puts
a 3 on the stack.  [FRED] executes the ID (aka global name) 'FRED',
(remember that undefined ID's just push themselves onto the stack),
left-shift [FRED] will try to STO level1 into 'FRED', and right-shift
[FRED] will try to RCL 'FRED's contents.  Similarly, [WIL] will evaluate
the ID 'a', left-[WIL] will STO into ID 'a', and right-[WIL] will RCL ID
'a'.  Note that 'b' and 'c' are ignored.  I find the distinction between
the formats of [123] and [WIL] to be a common stumbling block.  (Ie, the
syntax of [WIL]'s entry is used when the syntax (& functionality) of
[123]'s entry is desired.)

Above, we used strings and ID's to lable the key.  A LAM (lambda or local
name) can also be used, as can a GROB.  To work, the GROB must be have
dimentions 21x8.  Anything else is rejected.

As an example, lets make a lable that is more informative than [123] above,
but with the same functionality (ie unshifted is 1, left shifted is 2, and
right shifted is 3).  The GROB below:
GROB 21 8 FFFFF13FFF91DE7F717F3F91BF7F711E7F91FF3EF1FFFFF1
which looks like:
			#####################
			##  #############  ##
			# ## ###### ####### #
			### ######  #####  ##
			## ######## ####### #
			#    ###### #####  ##
			##########   ########
			#####################

gives a better picture (pardon the pun) of what the key does.  So if you
were to use the following as your argument to MENU or TMENU:
{ { GROB 21 8 FFFFF13FFF91DE7F717F3F91BF7F711E7F91FF3EF1FFFFF1 { 1 2 3 }
	} FRED { "WIL" a b c } }
you would have the above GROB (I'll call it [213]) in position a, [FRED] in
b, and [WIL] in c, working just like the [123][FRED][WIL] menu did.

Notice that to have menu lables that are the same size as the built-in
ones, the top row of pixels in the 21x8 GROB should be left blank, unlike
what I did above.  However, if all of your menus are icons, you might as
well use all 8 pixel-rows.

(Also note that in internal menus, the lable object can be anything that
returns a string, GROB, ID, or LAM to the stack; this is how those boxes
are included in the keys and toggled upon keypresses.)

I hope this has been helpful.

-JimC
--
James H. Cloos, Jr.		Phone:  +1 716 673-1250
cloos@ACSU.Buffalo.EDU		Snail:  PersonalZipCode:  14048-0772, USA
cloos@ub.UUCP			Quote:  <>

bson@rice-chex.ai.mit.edu (Jan Brittenson) (04/04/91)

In a posting of [3 Apr 91 21:01:00 GMT]
   cloos@acsu.buffalo.edu (James H. Cloos) writes:

 > Above, we used strings and ID's to lable the key.  A LAM (lambda or
 > local name) can also be used, as can a GROB.  To work, the GROB must
 > be have dimentions 21x8.  Anything else is rejected.

XLIB names work as well, in both user and internal menus.

						-- Jan Brittenson
						   bson@ai.mit.edu

akcs.briank@hpcvbbs.UUCP (Brian Korver) (04/05/91)

(Comp.sys.handhelds) Main: read 2259
Item: 2259 by EBERBERS%yubgef51 at pucc.PRINCETON.EDU
Author: [____ Zarko Berberski ____]
  Subj: Re: Menu lablels on the 48sx
  Keyw:
  Date: Thu Feb 28 1991 14:53
 Lines: 20
 
> Here's one way to do it.  It's not the best way, as the process can be
> automated.  But it works.
 
      Here it is - a little program that "converts" a string to a
GROB fom menu-label - it actually produces icon for subdirectory
but you can easily edit the GROB inside the program if you would
like a different shape.
 
 
%%HP: T(3)A(D)F(.);
DIR
 
  S\->MENU    @ (string - GROB) - dir-like icon
 
    \<< 1 \->GROB
GROB 21 8 E30000FFFFF1FFFFF1FFFFF1FFFFF1FFFFF1FFFFF1FFFFF1
{ # 3d # 2d } ROT
GXOR
    \>>
 
END

cloos@acsu.buffalo.edu (James H. Cloos) (04/05/91)

In article <14631@life.ai.mit.edu> bson@rice-chex.ai.mit.edu (Jan Brittenson) writes:
|In a posting of [3 Apr 91 21:01:00 GMT]
|   cloos@acsu.buffalo.edu (James H. Cloos) writes:
|
| > Above, we used strings and ID's to lable the key.  A LAM (lambda or
| > local name) can also be used, as can a GROB.  To work, the GROB must
| > be have dimentions 21x8.  Anything else is rejected.
|						^^**SEE BELOW
|XLIB names work as well, in both user and internal menus.

Er ya, duh, of course.  ;)
No idea why I forgot to mention them. [SIGH]

As for the "SEE BELOW" I added above, I meant to say that any grob size
other than 21x8 will have the errect of putting GRAP (short for "Graphic
Object" on the menu key; hitting the key works just as it would if the GROB
were of the propper size.


-JimC
--
James H. Cloos, Jr.		Phone:  +1 716 673-1250
cloos@ACSU.Buffalo.EDU		Snail:  PersonalZipCode:  14048-0772, USA
cloos@ub.UUCP			Quote:  <>

ahernsd@mentor.cc.purdue.edu (Dynastar) (04/05/91)

In <14631@life.ai.mit.edu> bson@rice-chex.ai.mit.edu (Jan Brittenson) writes:
>In a posting of [3 Apr 91 21:01:00 GMT]
>XLIB names work as well, in both user and internal menus.

I don't know what an XLIB is, I don't suppose anyone could post
something about them?
-- 
Sean Ahern ----------- Purdue University --------- ahernsd@mentor.cc.purdue.edu
Dan Quayle: "Japan is an important ally of ours.  Japan and the United States
             of the Western industrialized capacity, 60 percent of the GNP,
  :-)        two countries.  That's a statement in and of itself."

bson@rice-chex.ai.mit.edu (Jan Brittenson) (04/05/91)

In a posting of [4 Apr 91 22:49:16 GMT]
   ahernsd@mentor.cc.purdue.edu (Dynastar) writes:

 > I don't know what an XLIB is, I don't suppose anyone could post
 > something about them?

   An XLIB is just any command or function, built-in or supplied by a
library. So it means you can store the following in your CST variable:

	{ { \->Q { << 100 DO\->Q >> } } }

   Which will result in a menu key with the label "->Q" but which will
run << 100 DO->Q >>.


   BTW, this makes me wonder about one thing... What if a library with
the number 2 is attached... I bet a number of system menus would have
new labels. (This can be done by altering the library after it is
attached.)

						-- Jan Brittenson
						   bson@ai.mit.edu