Path: utzoo!attcan!uunet!cs.utexas.edu!oakhill!dover!cowan From: cowan@dover.sps.mot.com (Andrew H Cowan) Newsgroups: comp.windows.x Subject: Help needed mixing Xlib & Athena widgets. Message-ID: <2437@dover.sps.mot.com> Date: 22 Oct 90 19:36:47 GMT Reply-To: cowan@soleil.sps.mot.com.UUCP (Andrew H Cowan) Distribution: na Organization: Motorola, Chandler, AZ Lines: 79 (Oooops forgot to include the code I need help with....) Can anyone out there tell me what I'm doing wrong in the following code? I'm trying to create a window within (beneath ?) an Athena Viewport widget that I can use to draw text & graphics. When I try to create an Xlib "SimpleWindow" with the previously create Athena Viewport widget as the parent I get this error: X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 1 (X_CreateWindow) Resource id in failed request: 0x0 Serial number of failed request: 5 Current serial number in output stream: 17 What am I doing wrong? -AC ** / \ ** ** ** | | ** ** ** ** \___/ ** ** ******** ** ** ****** __ ** **** ** \_/oo\_/ **** ** ........**..........\||/................****.........**........... Andy Cowan...........||.............cowan@soleil.sps.mot.com...... ========================CUT HERE================================= /* compile: cc -g -o this thisfile.c -lXaw -lXmu -lXext -lXt -lX11 */ #include #include #include #include #include #include #include #include #include #include Widget Toplevel; /* The Top of the widget hierarchy */ main(argc, argv) int argc; char *argv[]; { XtAppContext xdvappcon; Widget viewport,vpform,box; Window win; Arg viewportargs[10]; int j; Toplevel = XtAppInitialize( &xdvappcon, "xaw", NULL, 0, &argc, argv, NULL, NULL, 0 ); j=0; XtSetArg( viewportargs[j], XtNforceBars, TRUE); j++; XtSetArg( viewportargs[j], XtNwidth, 100); j++; XtSetArg( viewportargs[j], XtNheight, 100); j++; viewport = XtCreateManagedWidget( /* Viewport with scroll bars */ "viewport", boxWidgetClass, Toplevel, viewportargs, j); win = XCreateSimpleWindow( /* A window parented by Viewport */ XtDisplay( viewport ), XtWindow( viewport ), 10, 10, 50, 50, 1, 1, 1 ); XMapWindow( XtDisplay( viewport ),win ); XtRealizeWidget( Toplevel ); XtAppMainLoop(xdvappcon); }