home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_08 / 8n08106b < prev    next >
Text File  |  1990-07-18  |  796b  |  42 lines

  1. Events and Windows
  2. Richard Rathe MD
  3. Listing 4
  4.  
  5. /*** text window activate method ***/
  6.  
  7. void t_activate(window,windinfo)
  8. WindowPtr window;
  9. WIND      *windinfo;
  10. {
  11.   TEHandle  tehandle;
  12.  
  13.         /* get data handle */
  14.   
  15.   tehandle = 
  16.     (TEHandle)windinfo->data;
  17.   
  18.         /* activate event */
  19.   
  20.   if(event.modifiers & activeFlag)
  21.   {
  22.     TEActivate(tehandle);
  23.     HiliteControl(((WindowPeek) window)
  24.       ->controlList,ENABLE);
  25.     TEFromScrap();
  26.     enable_edit((**tehandle).selEnd 
  27.       - (**tehandle).selStart);
  28.     enable_find();
  29.   }
  30.   else  /* deactivate event */
  31.   {
  32.     TEDeactivate(tehandle);
  33.     HiliteControl(((WindowPeek) window)
  34.       ->controlList,DISABLE);
  35.     ZeroScrap();
  36.     TEToScrap();
  37.     disable_edit();
  38.     disable_find();
  39.   }
  40. }
  41.  
  42.