home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 19013 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.1 KB  |  64 lines

  1. Path: sparky!uunet!spool.mu.edu!sgiblab!adagio.panasonic.com!chorus.mei!oskgate0.mei!icspub!wnoc-kyo!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: 6500msd@ucsbuxa.ucsb.edu (Michael D'Errico)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: PLEASE HELP ME WITH THIS CALLBACK PROBLEM!
  5. Message-ID: <1992Dec31.083110.11143@sm.sony.co.jp>
  6. Date: 31 Dec 92 08:31:10 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: Workstation Div., Supermicro Systems Group, Sony Corporation
  10. Lines: 51
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: 31 Dec 92 00:25:48 GMT
  14. Message-Id: <7220@ucsbcsl.ucsb.edu>
  15. Newsgroups: comp.windows.x
  16. References: <1992Dec26.140057.62273@cc.usu.edu>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19. In article <1992Dec26.140057.62273@cc.usu.edu> sllkz@cc.usu.edu writes:
  20.  
  21. >  Hi all,
  22. >         I have a problem regarding text widget. I have a text widget which
  23. >always reads from a file and displays its contents. But the problem is that
  24. >the callbacks relating to text widget are for activate,focus,.... etc while
  25. >I NEED to invoke the callback always, no matter what. These predefined 
  26. >callbacks dont help me at all Since the user will be doing other things that
  27. >wouldnt activate the predefined callbacks. I hope I have made myself clear
  28. >on this.
  29. >     So the question is: Is there a callback resource I can use with
  30. >XtAddCallback  so that the callback function is always called no matter what.
  31.  
  32. First of all this belongs in comp.windows.x.motif, but I'll answer anyway
  33. (I don't know how to redirect followups so don't flame me for this)
  34.  
  35. I don't know why you want to have a callback function called "always, no matter
  36. what" -- there has to be SOME reason for it to be called...
  37. You can call a callback routine whenever you want using the XtCallCallbacks()
  38. function as in:
  39.  
  40. void always_no_matter_what(w,client,call)
  41.   Widget w;
  42.   XtPointer client;
  43.   XmAnyCallbackStruct *call;
  44.   {
  45.   do_whatever();
  46.   }
  47.  
  48. main()
  49.   {
  50.   .
  51.   .
  52.   .
  53.   XtAddCallback(text_widget,XmNactivateCallback,always_no_matter_what,(XtPointer)NULL);
  54.   .
  55.   .
  56.   .
  57.   while (True)
  58.     XtCallCallbacks(text_widget,XmNactivateCallback,(XtPointer)NULL);
  59.   }
  60.  
  61. but of course this wouldn't make much sense!
  62.  
  63. Mike
  64.