Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!agate!labrea!rutgers!njin!princeton!phoenix!ssroy From: ssroy@phoenix.Princeton.EDU (Steve Scot Roy) Newsgroups: comp.windows.x Subject: Multiple independant widgets Message-ID: <5799@phoenix.Princeton.EDU> Date: 25 Jan 89 01:39:57 GMT Organization: Princeton University, NJ Lines: 61 I have another novice type question. I was trying to create two semi-independent widgets in the same application and I did what seemed to be the obvious thing -- I created two widgets under toplevel, one of type compositeWidgetClass and the other asciiStringWidgetClass -- and it didn't work. Every time the one which I declare first is the only one to appear, and it performs entirely as expected. Also, it is ignoring the XtNx and XtNy fields in the ArgLists. I know I can get these two windows as subwindows of a VPaned or some such, but I was hoping the have them independent. Do I need to do something special to do that? Thanks in advance. Here is the main of the routine if it helps. void main(argc, argv) unsigned int argc; char **argv; { Widget toplevel; static Arg typingArgList[] = { {XtNstring, (XtArgVal) default_value}, {XtNeditType, (XtArgVal) XttextEdit}, {XtNtextOptions, 0}, {XtNx, (XtArgVal)100}, {XtNy, (XtArgVal)200}, {XtNwidth, (XtArgVal)50}, {XtNheight, (XtArgVal)100}, }; static Arg drawingArgList[] = { {XtNx, (XtArgVal)100}, {XtNy, (XtArgVal)200}, {XtNwidth, (XtArgVal)50}, {XtNheight, (XtArgVal)100}, }; toplevel = XtInitialize("textTest", "Demo", table, XtNumber(table), &argc, argv); XtGetApplicationResources(toplevel, &app_resources, resources,XtNumber(resources), NULL, 0); /* set up the drawing widget. */ Drawing = XtCreateManagedWidget("drawing",compositeWidgetClass,toplevel, drawingArgList,XtNumber(drawingArgList)); /* Set up the typing widget. */ typingArgList[0].value = (XtArgVal) default_value; if (app_resources.word_wrap) typingArgList[2].value = wordBreak; Typing = XtCreateManagedWidget("typing",asciiStringWidgetClass,toplevel, typingArgList, XtNumber(typingArgList) ); XtRealizeWidget(toplevel); XtMainLoop(); }