home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14925 < prev    next >
Encoding:
Text File  |  1992-09-02  |  4.5 KB  |  227 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!munnari.oz.au!uniwa!cujo!NewsWatcher!user
  3. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  4. Subject: Re: Adding Balloon help to my App...
  5. Message-ID: <peter-030992130709@134.7.50.3>
  6. Followup-To: comp.sys.mac.programmer
  7. Sender: news@cujo.curtin.edu.au (News Manager)
  8. Organization: NCRPDA, Curtin University
  9. References: <1992Sep2.132611.23290@utkux1.utk.edu>
  10. Date: Thu, 3 Sep 1992 05:13:30 GMT
  11. Lines: 214
  12.  
  13. In article <1992Sep2.132611.23290@utkux1.utk.edu>, danny@utkux1.utk.edu
  14. (Danny W. McCampbell) wrote:
  15. > Is there an easy way to add balloon help to my Application.
  16. > I ready IM Vol VI and understand the resources, but when
  17. > I create the resources in resedit I get the hex editor.
  18. > Can anyone give me any tips on how to get started?
  19.  
  20. Whatever you do, don't use BalloonWriter or you'll spend more time fighting
  21. it than adding balloons!  The best way I've found is to use ResEdit to
  22. create the dialog, and then set the DITL resource's Balloon Help to
  23. HMscanhdlg, ID <whatever>, and then use SARez, and life is relatively
  24. simple.  Here's an example rez source:
  25.  
  26. #include "Types.r"
  27. #include "BalloonTypes.r"
  28.  
  29. resource 'hdlg' (1002, "DITL 202") {
  30.     2,
  31.     0,
  32.     0,
  33.     0,
  34.     0,
  35.     HMSkipItem {
  36.  
  37.     },
  38.     {    /* array HDialogArray: 10 elements */
  39.         /* [1] */
  40.         HMStringResItem {
  41.             {0, 0},
  42.             {0, 0, 0, 0},
  43.             1002,
  44.             1,
  45.             0,
  46.             0,
  47.             0,
  48.             0,
  49.             0,
  50.             0
  51.         },
  52.         /* [2] */
  53.         HMStringResItem {
  54.             {0, 0},
  55.             {0, 0, 0, 0},
  56.             1002,
  57.             2,
  58.             0,
  59.             0,
  60.             0,
  61.             0,
  62.             0,
  63.             0
  64.         },
  65.         /* [3] */
  66.         HMStringResItem {
  67.             {0, 0},
  68.             {0, 0, 0, 0},
  69.             1002,
  70.             3,
  71.             0,
  72.             0,
  73.             0,
  74.             0,
  75.             0,
  76.             0
  77.         },
  78.         /* [4] */
  79.         HMSkipItem {
  80.  
  81.         },
  82.         /* [5] */
  83.         HMStringResItem {
  84.             {0, 0},
  85.             {0, 0, 0, 0},
  86.             1002,
  87.             4,
  88.             0,
  89.             0,
  90.             0,
  91.             0,
  92.             0,
  93.             0
  94.         },
  95.         /* [6] */
  96.         HMStringResItem {
  97.             {0, 0},
  98.             {0, 0, 0, 0},
  99.             0,
  100.             0,
  101.             0,
  102.             0,
  103.             1002,
  104.             5,
  105.             1002,
  106.             5
  107.         },
  108.         /* [7] */
  109.         HMStringResItem {
  110.             {0, 0},
  111.             {0, 0, 0, 0},
  112.             1002,
  113.             6,
  114.             0,
  115.             0,
  116.             0,
  117.             0,
  118.             0,
  119.             0
  120.         },
  121.         /* [8] */
  122.         HMStringResItem {
  123.             {0, 0},
  124.             {0, 0, 0, 0},
  125.             1002,
  126.             7,
  127.             0,
  128.             0,
  129.             0,
  130.             0,
  131.             0,
  132.             0
  133.         },
  134.         /* [9] */
  135.         HMStringResItem {
  136.             {0, 0},
  137.             {0, 0, 0, 0},
  138.             1002,
  139.             8,
  140.             0,
  141.             0,
  142.             0,
  143.             0,
  144.             0,
  145.             0
  146.         },
  147.         /* [10] */
  148.         HMStringResItem {
  149.             {0, 0},
  150.             {0, 0, 0, 0},
  151.             1002,
  152.             9,
  153.             0,
  154.             0,
  155.             0,
  156.             0,
  157.             0,
  158.             0
  159.         }
  160.     }
  161. };
  162.  
  163. resource 'STR#' (1002, "BH for hmnu 202") {
  164.     {    /* array StringArray: 4 elements */
  165.         /* [1] */
  166.         "Click here to save the changes that you "
  167.         "have made.  The changes will take effect"
  168.         " for all future logins.",
  169.         /* [2] */
  170.         "Click here if you don't want to make any"
  171.         " changes.",
  172.         /* [3] */
  173.         "Click here if you make a mistake and wis"
  174.         "h to discard all the changes you have ma"
  175.         "de.",
  176.         /* [4] */
  177.         "Type in the default directory here.  Thi"
  178.         "s is the directory a user will start in "
  179.         "if they are not explicitly listed in the"
  180.         " menu below.",
  181.         /* [5] */
  182.         "Select a user with this menu, and then e"
  183.         "dit their username and/or their startup "
  184.         "directory.",
  185.         /* [6] */
  186.         "Click here if you wish to create a new u"
  187.         "ser.  Then type in the user╒s name and t"
  188.         "he user╒s initial directory.  Note that "
  189.         "you only need to create a user if you wa"
  190.         "nt to give them an initial directory - a"
  191.         "ll the users in your Users & Groups file"
  192.         " can login.\n",
  193.         /* [7] */
  194.         "Click here to delete the currently selec"
  195.         "ted user.",
  196.         /* [8] */
  197.         "This is the username of the selected use"
  198.         "r.  When a user with this name logs in t"
  199.         "hey will start in the directory specifie"
  200.         "d below.",
  201.         /* [9] */
  202.         "This is the initial directory for the se"
  203.         "lected user.  When they log in they will"
  204.         " start in this directory.  Type it in as"
  205.         " you would enter it in a ╥cd╙ command if"
  206.         " you had logged in from a standard Un*x "
  207.         "FTP client."
  208.     }
  209. };
  210.  
  211. The hdlg resource has items for each dialog item.  There is a hdlg item in
  212. the array for each DITL item, and each hdlg item has four strings (STR# id,
  213. index pairs) attached to it (Normal, Disabled, Checked, something else). 
  214. Just use the first one, and if it doesn't work try the others... (there are
  215. some bizzare cases, like for PopUps, it uses one if the first menu item is
  216. currently selected and another if not...)
  217.  
  218. This requires much less effort than fighting with Balloon Writer!
  219.  
  220. Have fun all,
  221.    Peter.
  222.  
  223. _______________________________________________________________________
  224. Peter N Lewis, NCRPDA, Curtin University       peter@cujo.curtin.edu.au
  225. GPO Box U1987, Perth WA 6001, AUSTRALIA             FAX: +61 9 367 8141
  226.