Path: utzoo!mnetor!uunet!lll-winken!ubvax!vix From: vix@ubvax.UB.Com (Paul Vixie) Newsgroups: comp.windows.x Subject: XtDestroyWidget()'s effects not immediate? Message-ID: <6575@ubvax.UB.Com> Date: 7 Apr 88 06:44:12 GMT Reply-To: vix@ubvax.UUCP (Paul Vixie) Organization: Ungermann-Bass Enterprises Lines: 47 In my ever-more-bizarre quest for odd-looking menus, I've run into a situation where I need to XtDestroyWidget() a couple of boxes-of-buttons and then immed- iately create another box-of-buttons. All this is happening inside a large Box with a hack I call XtNshrinkToFit set to FALSE (default=TRUE) to keep the box from shrinking to its minimum possible size every time I breathe on it. The new box-of-buttons (a menu) is created with a call to XtCreateWidget() for a box (with another hack called XtNalignVertical set to TRUE (default=FALSE)), then a bunch of XtCreateManagedWidget()'s for the buttons in the box, then a XtManageChild(theBox). This all works, but there's some flashing I'd like to better understand. The new box-of-buttons flashes into position in the next available spot in the outermost (XtNshrinkToFit=FALSE) box, then the box (or boxes) of buttons I'd XtDestroyWidget()'ed disappears and the new box-of-buttons moves into the space vacated by the two that are now gone. Note that in its temporary life as a flash of light, the new box-of-buttons has its lines drawn but NOT its text. All the lines -- the box itself and the boxes around the buttons. But not the text. Before the text can be drawn, the whole thing is destroyed and moved into the position vacated by the other boxes-of-buttons I'd previously destroyed. I thought to call this function after the XtDestroyWidget()'s and before the creation of the new box-of-buttons: static void FlushEventQueue() { XEvent e; while (XtPending()) { XtNextEvent(&e); XtDispatchEvent(&e); } } Cute as it is, it changed nothing. I think maybe the server is doing something to me as an optimization (which makes sense, drawing text on a Sun in cgfour mode is very slow). Can anyone offer a suggestion on how I can make the destroyed widgets go completely away (handled by the parent widget, etc) so I don't get a window dance when I create a new one in the same (parent) box? -- Paul Vixie Consultant Work: 408-562-7798 vix@ub.com vix%ubvax@uunet.uu.net Ungermann-Bass Home: 415-647-7023 {amdahl,ptsfa,pyramid,uunet}!ubvax!vix Santa Clara, CA <>