Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!ccut!wnoc-tyo-news!dclsic!sjc!spider!leia!harkcom From: harkcom@potato.pa.Yokogawa.Co.jp (Alton Harkcom) Newsgroups: comp.windows.x Subject: Re: Shaping windows in Xlib Message-ID: Date: 14 Sep 90 15:04:32 GMT References: Sender: news@leia.pa.yokogawa.co.jp Distribution: comp Organization: Yokogawa Electric Corporation, Tokyo, Japan. Lines: 71 In-reply-to: harkcom@potato.pa.Yokogawa.Co.jp's message of 14 Sep 90 02:01:56 GMT I got so many requests for the info that I decided to post a summary :-) The first reply I got was from: =} rws@expo.lcs.mit.edu (Bob Scheifler) =} =} Take a look at mit/lib/Xmu/ShapeWidg.c, particularly the =} internal function ShapeEllipseorRoundedRectangle. Even =} if you don't know Xt, you should be able to figure it out. I took a look and found many things that are useful to me. Gave me a lot of new toys to play with :-) The next came from: =} der Mouse =} =} Strictly speaking, this is not possible within Xlib. =} However, the SHAPE extension looks and feels (:-) like =} part of Xlib. Assuming you accept it as such.... =} =} You use XShapeCombineRegion, XShapeCombineRectangles, =} XShapeCombineMask, XShapeCombineShape, and/or =} XShapeOffsetShape to manipulate window shapes. (There =} are other routines as well; see the documentation.) In =} your case, I would guess that you probably want to =} use XShapeCombineMask. Which gave me even more toys to play with :-) And from: =} janssen@parc.xerox.com =} =} You will need to use the Shape extension. =} Here's a simple example program: [edited to be as small as I could make it... Al] #include #include /* include file for X extensions */ #define N 100 main (ac, av) int ac; char **av; { Display *d; Window w; Pixmap bmp; long junk; d = XOpenDisplay(""); w = XCreateSimpleWindow(d, DefaultRootWindow(d), N, N, N, N, 0, 0, 3); XReadBitmapFile (d, w, av[1], &junk, &junk, &bmp, &junk, &junk); XShapeCombineMask(d, w, ShapeBounding, 0, 0, bmp, ShapeSet); XMapWindow (d, w); XFlush(d); sleep(60); XCloseDisplay(d); } I appreciate all of the help, thank you :-) -- -- $@2#2OEE5!3t<02q