Path: utzoo!attcan!uunet!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Xlib graphics within widgets Message-ID: <8910111527.AA02573@LYRE.MIT.EDU> Date: 11 Oct 89 15:27:18 GMT References: <46739@bbn.COM> Sender: daemon@bloom-beacon.MIT.EDU Organization: DEC/MIT Project Athena Lines: 21 > What is wrong with my attempt below? (The thing compiles > and executes without error but does not draw the rectangle. MostFrequentBeginningXProblemNumber9 (in a slightly different guise :-) - You've got to wait for the server to send you an Expose event before assuming that anything you draw will be displayed. In the case of widgets, this is normally accomplished by moving all your drawing code into the 'expose' widget class procdure. Since you're attaching your drawing code to an existing widget, you don't have this option, so instead you could add an event handler. You could still loose, though, as there's no guaranteed call ordering between the event handler and the class expose procedure. Your best bet is to read the last part of the Athena Widgets documentation and customize the Template widget to your heart's content, or to use a bare Core widget (class 'widgetClass' in R3) which has no expose procedure and therefore won't destroy any drawing you do in an expose event handler.