[comp.windows.x] Help getting started with Motif.

tims@teklds.WR.TEK.COM (Tim Stoehr) (11/02/89)

I'm just getting started using motif and with the documentation am having
a difficult time getting started.  Perhaps some knowlegeable types out there
could lend some advice about a particular simple problem.

I want to have a window, forget about resizing/exposing considerations.
In the window I want to draw a box with Xlib calls.  Inside the box I want
to draw two rectangular figures with Xlib calls.  I would then like a pop-up
menu to be associated with a mouse depression over each rectangular figure.
No scrolling of the window is necessary.

Which Xm calls to use?  It seems that a mainwindow, with a rowcolumn inside
and using XmCreatePopupMenu() inside the rowcolumn would be appropriate.
But can you draw with Xlib inside a mainwindow and a rowcolumn?  Is some
other structure more appropriate?  What args needs to be set in each
XmCreateXxx()?  How do you specify your particular popup menu?

schoeller@gvriel.enet.dec.com (Dick Schoeller) (11/07/89)

In article <593@wrgate.WR.TEK.COM>, tims@teklds.WR.TEK.COM (Tim Stoehr) writes:

> I want to have a window, forget about resizing/exposing considerations.
> In the window I want to draw a box with Xlib calls.  Inside the box I want
> to draw two rectangular figures with Xlib calls.  I would then like a pop-up
> menu to be associated with a mouse depression over each rectangular figure.
> No scrolling of the window is necessary.
> 

You want to use an XmDrawingArea inside an XmMainWindow.  You can then use
XmCreatePopupMenu to get the popup menu as a child of the mainWindow.  The
drawingArea is the only widget which supports application supplied Xlib
graphics.

Dick Schoeller			| schoeller@gvriel.enet.dec.com
Digital Equipment Corporation	| 508-493-1670 
129 Parker Street, PKO3-1/H21	| 
Maynard, MA 01754-2571		| This author has no opinions to disclaim!