Path: utzoo!attcan!uunet!husc6!bloom-beacon!WHEATIES.AI.MIT.EDU!sundar From: sundar@WHEATIES.AI.MIT.EDU (Sundar Narasimhan) Newsgroups: comp.windows.x Subject: Form widget question Message-ID: <8812182315.AA16200@special-k.ai.mit.edu> Date: 18 Dec 88 23:15:18 GMT References: <8812151934.AA20687@rothko.cray.com> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 47 If you are using the athena form widget equalizing widths horizontally and heights vertically may be a problem depending on how you create the widgets initially. My solution was to have a equalize_geometry(widget_list, XtNwidth) procedure that just resizes the widgets to be of equal widths once they have been created. -Sundar ps. here's that piece of code xt_equalize_geometry(direction, list) char *direction; /* XtNwidth/XtNheight */ xt_widget_list list; { xt_widget_list l; Arg args[W_MAXARGS]; int i = 0; Dimension width, height, borderwidth; int maxvalue = 0; int widflag = 0; xt_set_args(args, &i, W_MAXARGS, XtNwidth, &width, XtNheight, &height, XtNborderWidth, &borderwidth, NULL); if(strcmp(direction, XtNwidth) == 0) widflag = 1; for(l = list; l != NULL; l = l->next) { XtGetValues(l->widget, args, i); if(widflag) { if (maxvalue < width) maxvalue = width; } else if(maxvalue < height) maxvalue = height; } for(l = list; l != NULL; l = l->next) { XtGetValues(l->widget, args, i); XtResizeWidget(l->widget, (widflag == 1) ? maxvalue : width, (widflag == 1) ? height : maxvalue, borderwidth); } return(maxvalue); }