Ibrahim Haddad wrote:
> 1. When drawing a line/rectangle with XmDrawLine/XmDrawRectangle,
Do you mean XDrawLine/XDrawRectangle? (or has Motif had some new
functions added?)
> how to specify
> the color of the object (as red/green/blue..) when it is drawn in black
> (may be as default color)?
Use XSetForeground or XChangeGC. Note that you need to use a GC which
permits the foreground attribute to be modified. Non-shared GCs
(created with XCreateGC) can have any attributes modified.
Shared GCs can only have certain attributes modified. GCs obtained
from XtGetGC can't have any attributes modified, while those obtained
from XtAllocateGC only permit modification of those fields specified
by the dynamic_mask (5th) parameter.
The simplest approach is to just allocate an unshared GC with
XCreateGC.
> 2.In a drawing area, i would like to do the folowing:
> When the user clicks on the area between the co-ordinates(x,y,x1,y1), I would
> like to popup a motif window. Any ideas?
Register a callback for XmNinputCallback. This will be passed a
pointer to an XmDrawingAreaCallbackStruct as the callData argument,
the event field of which contains a pointer to the XButtonEvent.
> 3. How to keep the drawing area refreshed because whenver I add some object, it
> is added dynamically while the drawing area window is open, but the objects get
> missed-up because of the change of the coordinates. However, when i move any
> other window above it, it is refreshed! Any ideas why?
I'm not sure what you are saying here. If the window is redrawn
correctly when re-exposed, then the code that changes the contents of
the window presumably isn't performing re-display correctly.
The simplest approach is to just call
XClearArea(dpy, win, 0, 0, 0, 0, True);
whenever you change the data that is used in drawing the window. If
that works, then it sounds as if you're not redrawing everything that
you should.
Or maybe I misunderstand what you're saying.
--
Glynn Clements <[EMAIL PROTECTED]>