[comp.windows.x] callbacks

gates@IPSUN.LARC.NASA.GOV (Ray Gates) (11/22/89)

HELP!!!!
I am having problems with callbacks. I have a commandWidget that has two
callback routines. One of these routines enables a popup. Based on an error
condition in my program, I want to remove the enabling of the popup from the
callback list. I tried using XtRemoveCallback but it seems to "miss" the first 
time around and still pops up the popup. What am I doing wrong??? What
alternatives (if any) do I have?? I know this probably doesn't make a lot
of sense but what does these days (editorial comment)?? Thanks in advance.
_______________________________________________________________________________
	"Mama, mama, many worlds       |	Ray Gates
	 have come since I first       |	CSC/NASA-Langley
               left home."	       |        gates@ipsun.larc.nasa.gov
				       |        804.865.1725
-------------------------------------------------------------------------------
DISCLAIMER: The comments/opinions contained within are my own and do not
            necessarily represent the opinions of my employer(s).
-------------------------------------------------------------------------------

gates@CSCSUN1.LARC.NASA.GOV (Ray Gates) (12/15/89)

Forgive me if this has been posted previously. Having problems with my
black hole mailer. 

HELP!!!!
I am having problems with callbacks. I have a commandWidget that has two
callback routines. One of these routines enables a popup. Based on an error
condition in my program, I want to remove the enabling of the popup from the
callback list. I tried using XtRemoveCallback but it seems to "miss" the first
time around and still pops up the popup. What am I doing wrong??? What
alternatives (if any) do I have?? I know this probably doesn't make a lot
of sense but what does these days (editorial comment)?? Thanks in advance.
_______________________________________________________________________________
        "Mama, mama, many worlds       |        Ray Gates
         have come since I first       |        CSC/NASA-Langley
               left home."             |        gates@ipsun.larc.nasa.gov
                                       |        804.865.1725
------------------------------------------------------------------------------

swick@ATHENA.MIT.EDU (Ralph R. Swick) (12/15/89)

> I am having problems with callbacks. I have a commandWidget that has two
> callback routines. One of these routines enables a popup. Based on an error
> condition in my program, I want to remove the enabling of the popup from the
> callback list. I tried using XtRemoveCallback but it seems to "miss" the first
> time around and still pops up the popup.

You're not, by any chance, calling XtRemoveCallback from a callback
that's on the list you're trying to change, are you?  There is
special code to make sure that any changes to a callback list
do not affect an in-progress evaluation of that list, producing
exactly the symptoms you describe.

Since there is no explicit ordering of invocation of the callbacks
on a list, you could never rely upon an "earlier" callback being
able to disable a "later" one by removing it from the list anyway.