Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hpcuhb!hp-sde!hpfcdc!hpfclp!diamant From: diamant@hpfclp.SDE.HP.COM (John Diamant) Newsgroups: comp.windows.x Subject: Re: XtUnmapWidget Message-ID: <9740043@hpfclp.SDE.HP.COM> Date: 25 Jul 88 02:50:31 GMT References: <8807222206.AA08510@dinorah.wustl.edu> Organization: HP SDE, Fort Collins, CO Lines: 30 > void NotImplemented() > { > XtMapWidget(w2); > XBell(dpy,50); > XFlush(dpy); > sleep(2); > XtUnmapWidget(w2); > XFlush(dpy); > } > > Every time when I activated command widget m2, the program came to > function c2 then it maps, rings bell, waits two seconds and unmaps. > It's all there execpt the text --- "not implemented". First of all, you might want to consider using XtPopup on a transientShell widget rather playing with mapped when managed within a form (your choice, but it would allow it to interact with a window manager better). Anyway, your problem is that you are not allowing the labelWidget to get an Expose event before you unmap the widget, so it never knows it is supposed to draw the contents. What you probably need to do is set a timer using XtAddTimeOut rather than doing a sleep. This way, you could have your function return, and XtMainLoop would give the labelWidget a chance to draw its contents. Then, when the timeout occurs, you will have registered a function to unmap the widget and everything will work out as you had intended. John Diamant Software Development Environments Hewlett-Packard Co. ARPA Internet: diamant@hpfclp.sde.hp.com Fort Collins, CO UUCP: {hplabs,hpfcla}!hpfclp!diamant