Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!bbn.com!nic!bunny!dcr0 From: dcr0@gte.com (David Robbins) Newsgroups: comp.windows.x.motif Subject: Re: making our own widget class under XmPrimitive -- but no 3D?? Message-ID: <10675@bunny.GTE.COM> Date: 28 Feb 91 13:56:43 GMT References: <1991Feb26.092658@wsl.dec.com> Distribution: na Organization: GTE Laboratories Incorporated, Waltham MA Lines: 31 From article <1991Feb26.092658@wsl.dec.com>, by klee@wsl.dec.com (Ken Lee): > In article <91Feb25.235707est.8813@orasis.vis.toronto.edu>, tjhorton@vis.toronto.edu ("Timothy J. Horton") writes: > |> Has anyone successfully created a widget from the XmPrimitive class? We have, > |> everything compiles, but no combination of resource settings will make the 3D > |> shadow effects be drawn (even if I draw NOTHING in the window). > > You didn't post any sample code, so I'm just guessing. How are you > attempting to draw the 3D shadow? Remember that XmPrimitive has no > drawing procedure, so you must draw everything that is displayed in > your widget's window. XmPrimitive does, however, provide GC resources > that make the 3D shadow easy. I've addressed a similar problem with Motif 1.0.3. I learned that you need to do the drawing of the shadows yourself, in your Expose procedure. Fortunately, you don't really need to know all about *how* do draw shadows. There exists an undocumented (at least in 1.0.3) function that knows how to draw shadows, and you just call it from your Expose procedure: _XmDrawShadow(XtDisplay(widget), XtWindow(widget), widget->primitive.bottom_shadow_GC, widget->primitive.top_shadow_GC, widget->primitive.shadow_thickness, x, y, width, height); (where x, y, width, height describe the outside bounds of the area to be shadowed -- perhaps x=0, y=0, width and height from widget->core). -- Dave Robbins GTE Laboratories Incorporated drobbins@bunny.gte.com 40 Sylvan Rd. ...!harvard!bunny!drobbins Waltham, MA 02254 CYA: I speak only for myself; GTE may disagree with what I say.