Path: utzoo!yunexus!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!bloom-beacon!BACH.CS.BYU.EDU!mike From: mike@BACH.CS.BYU.EDU (Mike Burbidge) Newsgroups: comp.windows.x Subject: Motif DrawingArea widget seems to ignore XmNresizePolicy widget? Message-ID: <9005312154.AA08275@bach.cs.byu.edu> Date: 31 May 90 21:54:49 GMT Article-I.D.: bach.9005312154.AA08275 Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 76 The motif DrawingArea widget has a resource named XmNresizePolicy. The documentation claims that it can be assigned three values: XmRESIZE_NONE, XmRESIZE_ANY, XmRESIZE_GROW. I created a SelectionBox widget whose working area widget is a DrawingArea widget with width and height 500 and XmNresizePolicy set to XmRESIZE_NONE. The manual puts (fixed size) next to XmRESIZE_NONE. I assume this means that the drawing area widget will ignore resize requests from its parents. Either I have misunderstood the short two word explaination for XmRESIZE_NONE, or else there is a bug somewhere. In either event the SelectionBox widget resizes the DrawingArea widget to 20x20. Below a short example program. ---------------------------------------------------------------------- #include #include #include #include #include #include #include #include main (int argc, char *argv[]) { Display *display; Widget appl_shell, dialog, selection, draw; XtAppContext context; Arg args[10]; int n; /* Initialize X11 and the Motif widget environment. */ XtToolkitInitialize (); context = XtCreateApplicationContext (); display = XtOpenDisplay (context, NULL, argv[0], "try", NULL, 0, &argc, argv); appl_shell = XtAppCreateShell (argv[0], "Root try", applicationShellWidgetClass, display, NULL, 0); XtResizeWidget (appl_shell, 5, 5, 1); n = 0; dialog = XmCreateDialogShell (appl_shell, "dialog", args, n); n = 0; XtSetArg (args[n], XmNdialogType, XmDIALOG_PROMPT), n++; selection = XtCreateWidget ("selection", xmSelectionBoxWidgetClass, dialog, args, n); n = 0; XtSetArg (args[n], XmNheight, 500), n++; XtSetArg (args[n], XmNwidth, 500), n++; XtSetArg (args[n], XmNresizePolicy, XmRESIZE_NONE), n++; draw = XmCreateDrawingArea (selection, "draw", args, n); XtManageChild (draw); XtManageChild (XmSelectionBoxGetChild (selection, XmDIALOG_APPLY_BUTTON)); XtUnmanageChild (XmSelectionBoxGetChild (selection, XmDIALOG_TEXT)); XtUnmanageChild (XmSelectionBoxGetChild (selection, XmDIALOG_SELECTION_LABEL)); XtUnmanageChild (XmSelectionBoxGetChild (selection, XmDIALOG_HELP_BUTTON)); XtManageChild (selection); XtManageChild (dialog); XtRealizeWidget (dialog); XtAppMainLoop (context); } ------------------------------------------------------------------ Could someone help me fix this program or give me an alternative so that the DrawingArea widget does not get resized! Mike Burbidge mike@bach.cs.byu.edu