home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!network.ucsd.edu!ucsbcsl!ucsbuxa!6500msd
- From: 6500msd@ucsbuxa.ucsb.edu (Michael D'Errico)
- Newsgroups: comp.windows.x
- Subject: Re: PLEASE HELP ME WITH THIS CALLBACK PROBLEM!
- Message-ID: <7220@ucsbcsl.ucsb.edu>
- Date: 31 Dec 92 00:25:48 GMT
- References: <1992Dec26.140057.62273@cc.usu.edu>
- Sender: root@ucsbcsl.ucsb.edu
- Lines: 46
-
- In article <1992Dec26.140057.62273@cc.usu.edu> sllkz@cc.usu.edu writes:
-
- > Hi all,
- > I have a problem regarding text widget. I have a text widget which
- >always reads from a file and displays its contents. But the problem is that
- >the callbacks relating to text widget are for activate,focus,.... etc while
- >I NEED to invoke the callback always, no matter what. These predefined
- >callbacks dont help me at all Since the user will be doing other things that
- >wouldnt activate the predefined callbacks. I hope I have made myself clear
- >on this.
- > So the question is: Is there a callback resource I can use with
- >XtAddCallback so that the callback function is always called no matter what.
-
- First of all this belongs in comp.windows.x.motif, but I'll answer anyway
- (I don't know how to redirect followups so don't flame me for this)
-
- I don't know why you want to have a callback function called "always, no matter
- what" -- there has to be SOME reason for it to be called...
- You can call a callback routine whenever you want using the XtCallCallbacks()
- function as in:
-
- void always_no_matter_what(w,client,call)
- Widget w;
- XtPointer client;
- XmAnyCallbackStruct *call;
- {
- do_whatever();
- }
-
- main()
- {
- .
- .
- .
- XtAddCallback(text_widget,XmNactivateCallback,always_no_matter_what,(XtPointer)NULL);
- .
- .
- .
- while (True)
- XtCallCallbacks(text_widget,XmNactivateCallback,(XtPointer)NULL);
- }
-
- but of course this wouldn't make much sense!
-
- Mike
-
-