Fellow Wafers! This patch for wafeperl 0.2 adds the following functionality: a) xt command line argument processing (wafeperl will accept -display ..., -bg pink, etc) b) better application class names derived from the perl script (in order to use application default files, etc) c) support for editres protocol when used with OSF/Motif + X11R5 (the Athena version supported editres from the beginning) Notes concerning (a): When the command line arguments are processed they are not removed automatically from Perl's @ARGV. As it looks to me, arguments cannot be removed from the Perl argument list from the c level without patching Perl itself. For the time being, one can use the following trick to adjust @ARGV by using Wafe's argument list: sub setargv { @ARGV=(); local($ARGC) = &wafe_cmd('return [set argc]'); for($i=0; $i<$ARGC; $i++) { push(@ARGV,&wafe_cmd("return [lindex [set argv] $i]")); } } &setargv(); In order to apply the patch change to .../perl-4.036/wafeperl and issue patch < wafeperl-0.2-patch1 try with the new version: wafe-sample -font fixed -bg turquoise Greetings, -gustaf ========================================================== wafeperl-0.2-patch1 *** wafesub.mus.orig Fri Dec 10 23:39:36 1993 --- wafesub.mus Fri Dec 10 23:33:39 1993 *************** *** 99,114 **** void init_wafe() { ! int argc = 1; ! char *progname = "perl"; ! char *argv[1]; char *filename = "wafesub.c"; - wafeScriptName = progname; - argv[0] = progname; /* setup Xt and Wafe */ ! wafeTopLevel = XtVaAppInitialize(&wafeAppContext, progname, NULL, 0, &argc, argv, NULL, NULL); wafeInit(argc,argv, False /* inputMode */, False /* promptMode */ --- 99,136 ---- void init_wafe() { ! int argc; ! char **argv; ! char *wafeAppClass; char *filename = "wafesub.c"; + int i; + char *p; + + wafeScriptName = "perl"; + + argc = origargc-1; + argv = (char*) XtMalloc(sizeof(char*)*argc); + + for(i=0;i\n",i,origargv[i]);*/ + if (i>0) argv[i-1] = origargv[i]; + } + + wafeAppClass = XtNewString(argv[0]); + if ((p = strrchr(wafeAppClass, '/'))) + wafeAppClass = ++p; + while((p = strrchr(wafeAppClass, '.'))) + *p = '-'; + *wafeAppClass = toupper(*wafeAppClass); + + /* setup Xt and Wafe */ ! wafeTopLevel = XtVaAppInitialize(&wafeAppContext, wafeAppClass, NULL, 0, &argc, argv, NULL, NULL); + MOTIF_EDITRES_HANDLER(wafeTopLevel); + wafeInit(argc,argv, False /* inputMode */, False /* promptMode */ ============================================================= -- Gustaf Neumann neumann@watson.ibm.com Postdoctoral/Visiting Scientist Tel: (914) 784 7086 IBM T.J.Watson Research Center, P.O.Box 704 Yorktown Heights, New York 10598