Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!stroyan From: stroyan@hpfcdc.HP.COM (Mike Stroyan) Newsgroups: comp.windows.x Subject: Re: widget with colormap Message-ID: <6910005@hpfcdc.HP.COM> Date: 29 Mar 89 01:14:29 GMT References: <8903281206.AA23640@faraday.ece.cmu.edu> Organization: HP Ft. Collins, Co. Lines: 22 > 1) Did I miss the "right" way of doing this? (ie: should > my widget really be calling XInstallColormap?) Don't call XInstallColormap. It is antisocial. The current ICCCM draft discusses telling the window manager by setting the WM_COLORMAP_WINDOWS property of the top-level window. The property contains a list of window ids for which the window manager should install the colormaps for when the application has colormap focus. The list is ordered in descending priority. A subwindow's colormap can be made more important by listing the top-level window after the subwindow. Otherwise the top-level window will have highest priority. Unfortunately, most window managers don't yet observe the WM_COLORMAP_WINDOWS property. For now you probably can get the effect you want by changing the colormap attribute of the top-level window whenever the widget is entered or exited. You can either keep the window id in a global variable or follow the widget parent entries to the top widget. If the parent window and widget window have different visuals, then this method can't be used. Mike Stroyan, stroyan@hpfcla.hp.com