Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Label Widgets Message-ID: <8906291637.AA02146@LYRE.MIT.EDU> Date: 29 Jun 89 16:37:17 GMT References: <8906261608.AA20658@schedule.mcs.anl.gov> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 32 > The > problem is that when I try to change label widgets when graphics are being > displayed the labels simply disappear from the screen. If no graphics > are being displayed, there is no problem. > ... > Arg args[1]; > XtUnmanageChild(item); > args[0].name = XtNlabel; > args[0].value = (XtArgVal) string; > XtSetValues(item, args, XtNumber(args)); > XtMapWidget(item); > XtManageChild(item); There's some pretty strange code here, but perhaps you know best. I can't think of many good reasons to unmanage a label before changing it and can't think of _any_ reason to recommend explicitly mapping a widget immediately before managing it. It's hard to diagnose your problem without more details, but one possible source of difficulty you may have overlooked is in the implementation of Label. When an XtSetValues is performed on Label, it does not immediately repaint in its new state; instead, it waits for an exposure event to arrive. This was intended to save multiple re-draws, assuming that a change in state often meant a change in size also. So, if your application is busy doing other output then the effect of the XtSetValues call on Label will not be visible until you finish the output and resume event processing. If you want a widget that displays its new label immediately, it is trivial to subclass Label to do it; you can inherit all the Label methods and write a one-line SetValues method that calls redisplay immediately.