Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!itsgw!brspyr1!tim From: tim@brspyr1.BRS.Com (Tim Northrup) Newsgroups: comp.windows.x Subject: Re: probs with popup windows Message-ID: <5834@brspyr1.BRS.Com> Date: 5 May 89 18:25:52 GMT References: <2461@lll-lcc.UUCP> Organization: BRS Information Technologies, Latham NY Lines: 46 From article <2461@lll-lcc.UUCP>, by chapman@lll-lcc.UUCP (Carol Chapman): > > program keeps running with garbage for the barcode. When it finishes, > *then* text appears in the popup window asking me for a barcode! If I > give it a barcode, it calls the check_barcode routine like I want > it to, but when that finishes, it never returns to the point where > XtPopup was originally called. Isn't it supposed to return to that point? This is where you went wrong (I recently hit the same problem). XtPopup() returns after the popup window is established, not after you return from any selection in the popup. In the case you describe, after calling XtPopup(), you should return; All after-selection processing gets done by the callback routines. Using your example, this is a rough idea of what you want: void DoThatPopup () { XtPopup(popup_shell); /* popup the dialog box */ /* cannot process barcode yet!!! */ return; /* return to main loop */ } void check_barcode () { if () { XtPopdown(popup_shell); /* all is well */ } return; /* return with or without popup */ } void cancel_action () { XtPopdown(popup_shell); /* remove popup */ return; /* return to main loop */ } Hope this helps. "It works for me." -- Hunter. -- Tim Northrup +------------------------------------------+ +---------------------------------+ GEnie: T.Northrup | UUCP: uunet!crdgw1!brspyr1!tim | Air Warrior: "Duke" | ARPA: tim@brspyr1.BRS.Com +------------------------------------------+