Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!munnari.oz.au!mel.dit.csiro.au!yarra!melba.bby.oz.au!gnb From: gnb@bby.oz.au (Gregory N. Bond) Newsgroups: comp.windows.x Subject: Xt shared GCs, regions and expose processing Message-ID: <1991May16.073250.14656@melba.bby.oz.au> Date: 16 May 91 07:32:50 GMT Sender: usenet@melba.bby.oz.au (news READER id) Organization: Burdett, Buckeridge and Young Ltd. Lines: 30 Nntp-Posting-Host: leo-gw The Xt manual states that GCs obtained via XtGetGC() "must be treated as read-only" (sec 11.4). However, I have seen a couple of widgets that do something like this in the widget redraw routine: if (region) XSetRegion(XtDisplay(w), w->widget.GC, region); .... /* do the draw */ .... if (region) XSetClipMask(XtDisplay(w), w->widget.GC, None); often with code to set region=NULL if it is clear it covers most of the window. This doesn't seem to be read-only, but from the point of view of multiple widget instances that may share the GC, the clip region is always None when the routine is entered. It is clear that this code works, at least in my situation. Is it "legal" to do so? If not, how should complex widgets handle expose events if they cannot legally set the clipmask in shared GCs but still want to avoid flicker from a full redraw? Greg. -- Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia Internet: gnb@melba.bby.oz.au non-MX: gnb%melba.bby.oz@uunet.uu.net Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb