Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!rochester!kodak!ektools!tan From: tan@ektools.UUCP (Thomas A. Napoli) Newsgroups: comp.windows.x Subject: X11R4 Dialog Widget Question Keywords: Dialog, Athena, HELP Message-ID: <2528@ektools.UUCP> Date: 22 Mar 90 02:07:17 GMT Sender: tan@ektools (Thomas A. Napoli) Reply-To: tan@ektools.UUCP (Thomas A. Napoli) Distribution: usa Organization: Eastman Kodak, Dept. 47, Rochester NY Lines: 64 References: --------------- I have had some problems posting to news recently, so this may be a repeat. If so, I apologize. --------------- I am running X11R4 on a Sun 3/60, SunOS 4.0.3 and trying to upgrade an application that uses the Athena widget set. A Dialog widget that displays a default string value works under R3 but not under R4. An X protocol error occurs using the following code. The "root_wid" is of the "formWidgetClass". I would appreciate any insight into what I might be doing wrong. The release notes indicate that changes are not necessary for the Dialog widget, but then again ... static Arg dialogArgs [] = { /* dialog widget set-up */ { XtNhorizDistance, (XtArgVal) 20 }, /* Form widget resource */ { XtNvertDistance, (XtArgVal) 60 }, /* Form widget resource */ { XtNwidth, (XtArgVal) 200 }, { XtNheight, (XtArgVal) 70 }, { XtNlabel, NULL }, { XtNvalue, NULL }, }; /* dialogArgs */ char *dest_folder; char *malloc (); dest_folder = malloc ( 100 ); /* subset of callback code follows */ char *dialog_label = "Enter destination folder name:"; if ( ! *dest_folder ) strcpy ( dest_folder, "default_folder" ); XawPanedSetRefigureMode ( pane, False ); dialogArgs[2].value = (XtArgVal) 220; dialogArgs[4].value = (XtArgVal) dialog_label; dialogArgs[5].value = (XtArgVal) dest_folder; dialog = XtCreateManagedWidget ( "dialog", dialogWidgetClass, root_wid, dialogArgs, XtNumber (dialogArgs) ); XawDialogAddButton ( dialog, "OK", Ok, client_data ); XawDialogAddButton ( dialog, "CANCEL", Cancel, (caddr_t) NULL ); XtRealizeWidget ( dialog ); This all works when the "XtNvalue" resource is set to NULL, but not when an initial value is assigned (as above). The X Protocol message: X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 38 (X_QueryPointer) Minor opcode of failed request: 0 Resource id in failed request: 0x0 Serial number of failed request: 205 Current serial number in output stream: 205 ------------------------------------------------------------------- Tom Napoli UUCP : ...!kodak!aviary!tan or tan@ssd.kodak.com Voice: (716) 253-7795