Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!bcm!etaylor From: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Newsgroups: comp.windows.x Subject: Re: a couple o' questions Message-ID: <3239@gazette.bcm.tmc.edu> Date: 18 Dec 90 16:26:11 GMT References: <1990Dec18.142305.23701@rice.edu> Sender: usenet@bcm.tmc.edu Reply-To: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Organization: Baylor College of Medicine, Houston, Tx Lines: 48 Nntp-Posting-Host: wilkins.iaims.bcm.tmc.edu In article <1990Dec18.142305.23701@rice.edu>, sam@uncle-bens.rice.edu (Samuel R Johnson) writes: |> hello. i've been not keeping up wih this group since last summer, |> so i apologize if any of this has been covered previously... |> |> two questions: |> |> with Xt, Athena - is there any *clean* way to get a command widget to |> display a pixmap? like, maybe a happy face or a frog or something? XtNbitmap resource. |> |> also with Xt, Athena - i realize this is taboo, but sometimes i'd really |> like to just draw into a widget with Xlib routines for one reason or |> another. when i try to do an |> |> XDrawRectangle(XtDisplay(w),XtWindow(w),XtGetGC(w,0,&val), |> 0, 0, width, height); |> |> i get nothing. thinking that perhaps the colors are set incorrectly (invisibly) You are using XtGetGC all wrong. First of all, you are passing 0 as the flag list. This means you will be getting a GC with nothing in it. You did not tell it which members of the XGCValues you wanted to use. You should create this GC beforehand so that you can free it up later. Here, you can never free it up. |> for the widget in its GC, i tried creating my own |> |> gc = XCreateGC(XtDisplay(w),XtWindow(w),None,NULL); /* defaults */ |> XDrawRectangle(XtDisplay(w),XtWindow(w),gc, |> 0, 0, width, height); This uses the Default GC settings which are unpredictable. Why not set the foreground explicitly? |> |> but still see nothing. any ideas? |> |> thanks a bunch. |> |> -Sam |> sam@owlnet.rice.edu -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bcm.tmc.edu (713) 798-3776