[comp.sys.mac.programmer] Controls and Dialogs

marty@cernvax.cern.ch (hugues marty) (02/12/91)

Hello, I would like to ask a few questions about controls in
dialogs.

1. I you want to set the font of a standard button to the window font,
   you must add 8 to the var code. But is there a way of having such
   a standard control in a DITL without having a CNTL resource ?
   I guess that the DITL does not contain the variation code so
   such a thing is not possible, but who knows?

2. Other wise, is there a way of modifying the var
   code when the control has been created (i.e. when the dialog has
   been created using the corresponding DITL)? I think that the
   var code doesn't appear in the ControlRecord (well, where is it
   then?).

Tnx for answering, Hugues.
-- 
e+ ----> :-) <---- e-                         e-mail :
Les Chercheurs de Bosons Unifies              marty@cernvax.cern.ch

lim@iris.ucdavis.edu (Lloyd Lim) (02/13/91)

In article <4138@cernvax.cern.ch> marty@cernvax.cern.ch (hugues marty) writes:
>1. I you want to set the font of a standard button to the window font,
>   you must add 8 to the var code. But is there a way of having such
>   a standard control in a DITL without having a CNTL resource ?
>   I guess that the DITL does not contain the variation code so
>   such a thing is not possible, but who knows?

Warning, plug coming.  If you use the Default CDEF you can set a button to use
the window font by adding a curly f to the end of the button title.  This lets
you actually see what the dialog will look like in ResEdit and edit it there.
You can also change between the window font and the system font on the fly
by changing the button title.  (Disclaimer - I wrote it.)

+++
Lloyd Lim     Internet: lim@iris.eecs.ucdavis.edu
              Compuserve: 72647,660
              US Mail: 215 Lysle Leach Hall, U.C. Davis, Davis, CA 95616

djvelleman@amherst.bitnet (02/13/91)

In article <4138@cernvax.cern.ch>, marty@cernvax.cern.ch (hugues marty) writes:
> 2. Other wise, is there a way of modifying the var
>    code when the control has been created (i.e. when the dialog has
>    been created using the corresponding DITL)? I think that the
>    var code doesn't appear in the ControlRecord (well, where is it
>    then?).

  According to IM-I, pages 328-9, the var code is stored in the high byte of
the contrlDefProc field of the control record.  I don't see why you couldn't
change it once the dialog has been created.
  But maybe this information is out of date.  Anyone know about a change in
the way var codes are handled?
  -Dan Velleman