Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!leah!rpi!weber.cs.rpi.edu!mcintyrd From: mcintyrd@cs.rpi.edu (David McIntyre) Newsgroups: comp.windows.x Subject: Athena Form Widget Bug? Keywords: Argh, EEEEkk, Phoey, Suicide Message-ID: <1681@rpi.edu> Date: 25 Apr 89 03:43:04 GMT Sender: usenet@rpi.edu Organization: Rensselaer Polytechnic Institute, Troy, NY Lines: 80 I have just tried Form Widgets, and I don't think they work. Here is what I want to do: a) create a form widget. b) add 3 labels, positioned as I want. c) make the labels un-resizable. Here is what happens: a) the labels get created. b) they are the wrong size (I ask for 25x30, the estimated actual size is 100x100) c) they resize when the window is resized. Is this a bug? You tell me, please. I would love to know what I am doing wrong. The sample code follows. Thanks, Dave -------------------------------------- #include #include #include #include #include #include void main(argc, argv) int argc; char **argv; { Arg arg[10]; XtAppContext ape; Display *dpy; Widget toplevel,form,label1,label2,label3; XtToolkitInitialize(); ape = XtCreateApplicationContext(); dpy = XtOpenDisplay(ape,NULL,argv[0],"Demos",NULL,0,&argc,argv); XtSetArg(arg[0],XtNwidth,(XtArgVal)300); XtSetArg(arg[1],XtNheight,(XtArgVal)200); toplevel = XtAppCreateShell(argv[0],"Demos", applicationShellWidgetClass,dpy,arg,2); form = XtCreateManagedWidget("form",formWidgetClass,toplevel,NULL,0); XtSetArg(arg[0],XtNresizable,False); XtSetArg(arg[1],XtNheight,25); XtSetArg(arg[2],XtNwidth,30); XtSetArg(arg[3],XtNresize,False); label1 = XtCreateManagedWidget("label1",labelWidgetClass,form,arg,4); XtSetArg(arg[0],XtNfromHoriz,label1); XtSetArg(arg[1],XtNhorizDistance,2); XtSetArg(arg[2],XtNresizable,False); XtSetArg(arg[3],XtNresize,False); XtSetArg(arg[4],XtNheight,40); XtSetArg(arg[5],XtNwidth,50); label2 = XtCreateManagedWidget("label2",labelWidgetClass,form,arg,6); XtSetArg(arg[0],XtNfromVert,label2); XtSetArg(arg[1],XtNvertDistance,0); XtSetArg(arg[2],XtNresizable,False); XtSetArg(arg[3],XtNresize,False); XtSetArg(arg[4],XtNheight,40); XtSetArg(arg[5],XtNwidth,50); label2 = XtCreateManagedWidget("label2",labelWidgetClass,form,arg,6); XtRealizeWidget (toplevel); XtAppMainLoop(ape); } Dave "mr question" McIntyre | "....say you're thinking about a plate mcintyre@turing.cs.rpi.edu | of shrimp.....and someone says to office : 518-276-8633 | you `plate,' or `shrimp'......" home : 518-271-6664 |