home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.3 / CrtGenHdlr.3 < prev    next >
Encoding:
Text File  |  1995-07-26  |  6.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333))))   TTTTkkkk (((( ))))    TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           Tk_CreateGenericHandler, Tk_DeleteGenericHandler - associate
  12.           procedure callback with all X events
  13.  
  14.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.           ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  16.  
  17.           TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr(_p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  18.  
  19.           TTTTkkkk____DDDDeeeelllleeeetttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr(_p_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  20.  
  21.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  22.           Tk_GenericProc   *_p_r_o_c        (in)      Procedure to  invoke
  23.                                                   whenever any X event
  24.                                                   occurs    on     any
  25.                                                   display.
  26.  
  27.           ClientData       _c_l_i_e_n_t_D_a_t_a   (in)      Arbitrary   one-word
  28.                                                   value   to  pass  to
  29.                                                   _p_r_o_c.
  30.      _________________________________________________________________
  31.  
  32.  
  33.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  34.           TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr arranges for _p_r_o_c to be  invoked  in
  35.           the  future  whenever any X event occurs.  This mechanism is
  36.           _n_o_t intended for dispatching X events on windows managed  by
  37.           Tk  (you should use TTTTkkkk____CCCCrrrreeeeaaaatttteeeeEEEEvvvveeeennnnttttHHHHaaaannnnddddlllleeeerrrr for this purpose).
  38.           TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr is intended for other purposes, such
  39.           as  tracing X events, monitoring events on windows not owned
  40.           by  Tk,  accessing  X-related  libraries   that   were   not
  41.           originally designed for use with Tk, and so on.
  42.  
  43.           The callback to _p_r_o_c will be made  by  TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt;  this
  44.           mechanism  only  works  in  programs  that  dispatch  events
  45.           through TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt (or through other Tk procedures  that
  46.           call TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt, such as TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt or TTTTkkkk____MMMMaaaaiiiinnnnLLLLoooooooopppp).
  47.  
  48.           _P_r_o_c should have arguments and result that  match  the  type
  49.           TTTTkkkk____GGGGeeeennnneeeerrrriiiiccccPPPPrrrroooocccc:
  50.                typedef int Tk_GenericProc(
  51.                     ClientData _c_l_i_e_n_t_D_a_t_a,
  52.                     XEvent *_e_v_e_n_t_P_t_r);
  53.           The _c_l_i_e_n_t_D_a_t_a parameter to _p_r_o_c is a copy of the _c_l_i_e_n_t_D_a_t_a
  54.           argument  given to TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr when the callback
  55.           was  created.   Typically,  _c_l_i_e_n_t_D_a_t_a  points  to  a   data
  56.           structure  containing application-specific information about
  57.           how to handle events.  _E_v_e_n_t_P_t_r is a pointer to the X event.
  58.  
  59.           Whenever an X event is processed by TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt, _p_r_o_c  is
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333))))   TTTTkkkk (((( ))))    TTTTkkkk____CCCCrrrreeeeaaaatttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr((((3333))))
  71.  
  72.  
  73.  
  74.           called.   The  return value from _p_r_o_c is normally 0.  A non-
  75.           zero return value indicates that the  event  is  not  to  be
  76.           handled  further; that is, _p_r_o_c has done all processing that
  77.           is to be allowed for the event.
  78.  
  79.           If there are multiple generic event handlers,  each  one  is
  80.           called  for  each  event,  in  the  order in which they were
  81.           established.
  82.  
  83.           TTTTkkkk____DDDDeeeelllleeeetttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr  may   be   called   to   delete   a
  84.           previously-created  generic  event handler:  it deletes each
  85.           handler it  finds  that  matches  the  _p_r_o_c  and  _c_l_i_e_n_t_D_a_t_a
  86.           arguments.     If    no    such    handler    exists,   then
  87.           TTTTkkkk____DDDDeeeelllleeeetttteeeeGGGGeeeennnneeeerrrriiiiccccHHHHaaaannnnddddlllleeeerrrr  returns  without  doing   anything.
  88.           Although  Tk  supports  it, it's probably a bad idea to have
  89.           more than one callback with the  same  _p_r_o_c  and  _c_l_i_e_n_t_D_a_t_a
  90.           arguments.
  91.  
  92.           Establishing a generic event handler does nothing to  ensure
  93.           that the process will actually receive the X events that the
  94.           handler wants to process.  For example, it is  the  caller's
  95.           responsibility  to invoke XXXXSSSSeeeelllleeeeccccttttIIIInnnnppppuuuutttt to select the desired
  96.           events, if that is necessary.
  97.  
  98.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  99.           bind, callback, event, handler
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/23/95)
  130.  
  131.  
  132.  
  133.