Question about XmDrawingArea

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

8 posts / 0 new
Last post
Question about XmDrawingArea

Submitted by Anonymous on Wed, 10/16/2002 - 03:06. Developers
The DrawingArea only povides a blank canvas for interactive drawing and does no drawing of its own.
If I want the sencondary dialog to display and draw something, what widget should I use.
When I use
XDrawLine( XtDisplay(drawing_area), XtWindow(drawing_area),gc,x1,y1,x2,y2);
I got nothing!!!

And if I draw a line beyond the drawing_area window, how can I display it?
Can the widget extend itself automatically?
Or what resource should I use to scroll the window?

Thank you very much!!!

Anonymous

Your line must be in the drawing area. The widget will not extend itself to contain the line.

You must add an expose callback where you you make all your drawings (XtAddCallback(drawing_area, XmNexposeCallback, your_callback, your_data_callback);). Each time the drawing area receives an expose event, it will draw.

Anonymous

Thank you very much!!!

So I have to calculate and extent the drawing area in the application with XtVaSetValues.
But how can I make the window display the specified position in the area, so the user dont have to drag the scroll bar to locate it.
Thanks a lot.
You do me a big favor!!!

Anonymous

If your drawing area is in a scrolled window, you may use the XmScrollBarSetValues to change the visible area. You may have the ScrollBar ID with the XmNhorizontalScrollBar and XmNverticalScrollbar properties if the ScrolledWIndow with XtGetValues or XtVaGetValues

Anonymous

I read man page for the XmScrollBarSetValues.
What I want to know is how can I get the scrollbar value, if I only know the position (x,y) that I want to display!!!

Thanks a lot!!!

Anonymous

You know the width and height of your drawing area, the x,y where you want to draw. You may know the XmNmaximum and XmNminimum of your scrollbars. You just have to set the values of the scrollbars accordingly.

Anonymous

You know the width and height of your drawing area, the x,y where you want to draw. You may know the XmNmaximum and XmNminimum of your scrollbars. You just have to set the values of the scrollbars accordingly.

Anonymous

Thank you pierrem22!!!
It is so nice of you help me solve this problem.