home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / 20651 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.8 KB  |  57 lines

  1. Path: sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!network.ucsd.edu!ucsbcsl!ucsbuxa!6500msd
  2. From: 6500msd@ucsbuxa.ucsb.edu (Michael D'Errico)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: PLEASE HELP ME WITH THIS CALLBACK PROBLEM!
  5. Message-ID: <7220@ucsbcsl.ucsb.edu>
  6. Date: 31 Dec 92 00:25:48 GMT
  7. References: <1992Dec26.140057.62273@cc.usu.edu>
  8. Sender: root@ucsbcsl.ucsb.edu
  9. Lines: 46
  10.  
  11. In article <1992Dec26.140057.62273@cc.usu.edu> sllkz@cc.usu.edu writes:
  12.  
  13. >  Hi all,
  14. >         I have a problem regarding text widget. I have a text widget which
  15. >always reads from a file and displays its contents. But the problem is that
  16. >the callbacks relating to text widget are for activate,focus,.... etc while
  17. >I NEED to invoke the callback always, no matter what. These predefined 
  18. >callbacks dont help me at all Since the user will be doing other things that
  19. >wouldnt activate the predefined callbacks. I hope I have made myself clear
  20. >on this.
  21. >     So the question is: Is there a callback resource I can use with
  22. >XtAddCallback  so that the callback function is always called no matter what.
  23.  
  24. First of all this belongs in comp.windows.x.motif, but I'll answer anyway
  25. (I don't know how to redirect followups so don't flame me for this)
  26.  
  27. I don't know why you want to have a callback function called "always, no matter
  28. what" -- there has to be SOME reason for it to be called...
  29. You can call a callback routine whenever you want using the XtCallCallbacks()
  30. function as in:
  31.  
  32. void always_no_matter_what(w,client,call)
  33.   Widget w;
  34.   XtPointer client;
  35.   XmAnyCallbackStruct *call;
  36.   {
  37.   do_whatever();
  38.   }
  39.  
  40. main()
  41.   {
  42.   .
  43.   .
  44.   .
  45.   XtAddCallback(text_widget,XmNactivateCallback,always_no_matter_what,(XtPointer)NULL);
  46.   .
  47.   .
  48.   .
  49.   while (True)
  50.     XtCallCallbacks(text_widget,XmNactivateCallback,(XtPointer)NULL);
  51.   }
  52.  
  53. but of course this wouldn't make much sense!
  54.  
  55. Mike
  56.  
  57.