Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!wuarchive!uunet!mcsun!hp4nl!dutrun!dutncp8!adri From: adri@dutncp8.tudelft.nl (A.B. van Woerkom) Newsgroups: comp.windows.x Subject: Re: Is a transparent background possible? Keywords: Xtoolkit background transparent Message-ID: Date: 3 Sep 90 07:41:04 GMT References: Sender: news@dutrun.UUCP Lines: 39 jwdb@dutnak2.tudelft.nl (Jan Willem de Bruijn) writes: >Has anyone ever managed to create transparent windows (or widgets) >using the Xtoolkit? It says in the Intrinsics Programming Manual >that the background attribute of a window can be transparent, but >nowhere is it explained how to accomplish that. When you set the background_pixmap field in the window attibutes to None the background of the window will be set equal to whatever it is behind your window when it is mapped, thus creating a transparent effect. However when the things behind your window change your window's background won't change with it. Also when your move your window the initial background will move with it. >Say, e.g., that I wanted to have a transparent background for the >Command widget in the xgoodbye application from Chapter 2 (as you >can tell from this, I am just learning to program using the toolkit), >how would I go about it? The obvious way, to put: > >*goodbye.background: transparent > >in the application-defaults file (or in ~/.Xdefaults) is not accepted >by the toolkit. You have to set *goobye.backgroundPixmap (to None) instead. This only can be done, however, from your program (XtSetArg and all that) because there is no string to pixmap converter (but you can allways write and register one yourself :-)). To get a really tranparent window, but one on which you can't draw, set the window type to InputOnly on creation, but how to archieve this from Xt I don't know. ________________________________________________________________________ Adri van Woerkom, adri@dutncp6.tudelft.nl Delft University of Technology, Faculty of Applied Physics, Department Physics Informatics, section Computational Physics, Lorentzweg 1, 2628 CJ DELFT, The Netherlands ________________________________________________________________________ "Do you want the usual answer or the truth?" (Igor Strawinsky)