[comp.sys.mac.programmer] SetItemStyle in LSC

stone@hydra.unm.edu (Andrew Stone CS.DEPT) (03/30/89)

	Here is an easy one that is baffling me: I am using LSC3.x and want to 
change a menu item's style with the SetItemStyle(MenuHandle,int,Style) routine.

IM I-360 suggests an example SetItemStyle(thismenu,1,[bold,italic]);

How do I do this in C? I tried enum, casting to type (Style),etc, recieving
a syntax error each time. I know my handle is valid, as I successfully 
SetItemText() in the line previous.

Thanks,         andrew

||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
||	   Andrew Stone	            ??		  Able was I            ||
||         stone@hydra.unm.edu	    <> 	    	ere I saw Elba          ||
||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||

beard@ux1.lbl.gov (Patrick C Beard) (03/31/89)

References: <4747@charon.unm.edu>
Sender: 
Reply-To: beard@ux1.lbl.gov (Patrick C Beard)
Followup-To: 
Distribution: usa
Organization: Lawrence Berkeley Laboratory, Berkeley
Keywords: Using predifined "Style"

In article <4747@charon.unm.edu> stone@hydra.unm.edu (Andrew Stone CS.DEPT) writes:
>	Here is an easy one that is baffling me: I am using LSC3.x and want to 
>change a menu item's style with the SetItemStyle(MenuHandle,int,Style) routine.
>
>IM I-360 suggests an example SetItemStyle(thismenu,1,[bold,italic]);
>
>How do I do this in C?
>

SetItemStyle(thismenu,1,bold+italic); does the trick.  You construct a style
by adding the various attribute constants together.

Hope that helps.


+----------------------------------------------------------------+
 \   Patrick Beard                 "Badges?                       \
  \    Berkeley Systems, Inc.        I ain't got to show you...    \
   \      PCBeard@lbl.gov                 ...NO STINKING BADGES!"   \
    + ---------------------------------------------------------------+

siegel@endor.harvard.edu (Rich Siegel) (03/31/89)

In article <4747@charon.unm.edu> stone@hydra.unm.edu (Andrew Stone CS.DEPT) writes:
>
>IM I-360 suggests an example SetItemStyle(thismenu,1,[bold,italic]);
>
>How do I do this in C? I tried enum, casting to type (Style),etc, recieving

	According to <QuickDraw.h>, the enumeration is called "Style". Since 
sets per se aren't supported in C, you get the same effect by adding (or
subtracting) the constants corresponding to the members. Therefore, the call is

	SetItemStyle(thismenu, 1, bold+italic);

		--Rich
~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

 "She told me to make myself comfortable, so I pulled down my pants
 and sat in the pudding." -Emo Phillips
~~~~~~~~~~~~~~~