| the following is a test driver (non-UIL) that creates 2 fs widgets.
fs #1 contains a work-area dialog box which in turns contains a
pushbutton. It works fine. Since I do not know UIL very well, perhaps
you could try to break this test driver?
Let me know...
Jay
#ifdef VMS
#include "decw$include:decwdwtwidgetprog.h"
#include <descrip.h>
#include <rmsdef>
#else
#include "/usr/include/X11/DECwDwtWidgetProg.h"
#endif
#include "Vendor.h"
/* Command line options table. Only resources are entered here...there is a
pass over the remaining options after XtParseCommand is let loose. */
static XrmOptionDescRec options[] = {
{"-label", XtNlabel, XrmoptionSepArg, NULL}
};
/*
* Report the syntax for calling xlabel
*/
Syntax(call)
char *call;
{
}
static FileSelectionWidget fileselect, fs2;
static Widget toplevel, create_fs_pb, exit_fs_pb, setval_pb, work, mainw;
static Widget shell,create_fs_pb2, setval_pb2, unmanage_pb, workbutton;
static Widget subwork;
static void bye_bye()
{
exit(1);
}
static DwtCallback bye_bye_cb[2] =
{
{(VoidProc) bye_bye, NULL},
{NULL, NULL}
};
static void manage()
{
XtManageChild(fileselect);
};
static DwtCallback manage_cb[2] =
{
{(VoidProc) manage, NULL},
{NULL, NULL}
};
static void manage2()
{
XtManageChild(fs2);
};
static DwtCallback manage_cb2[2] =
{
{(VoidProc) manage2, NULL},
{NULL, NULL}
};
static void getval(w,tag,reason)
Widget w;
int *tag;
unsigned long *reason;
{
Arg arglist[1];
DwtCompString value;
XtSetArg(arglist[0], DwtNvalue, &value);
XtGetValues(fileselect, arglist, 1);
};
static DwtCallback getval_cb[2] =
{
{(VoidProc) getval, NULL},
{NULL, NULL}
};
static void unmanage(w,tag,reason)
Widget w;
int *tag;
unsigned long *reason;
{
XtUnmanageChild(w);
getval(w,tag,reason);
};
static DwtCallback unmanage_cb[2] =
{
{(VoidProc) unmanage, NULL},
{NULL, NULL}
};
static void setval2(w,tag,reason)
Widget w;
int *tag;
unsigned long *reason;
{
Arg arglist[1];
XtSetArg(arglist[0], DwtNvalue, DwtLatin1String("a value"));
XtSetValues(fs2, arglist, 1);
};
static DwtCallback getval_cb2[2] =
{
{(VoidProc) setval2, NULL},
{NULL, NULL}
};
static void cvttoext(fs,oldmask,newmask)
FileSelectionWidget fs;
DwtCompString oldmask;
DwtCompString *newmask;
{
*newmask = DwtLatin1String("ext format");
};
static void cvttoint(fs,oldmask,newmask)
FileSelectionWidget fs;
DwtCompString oldmask;
DwtCompString *newmask;
{
*newmask = DwtLatin1String("*.c");
};
static void cvtfiletoext(fs,oldfile,filec,newfile)
FileSelectionWidget fs;
DwtCompString oldfile;
int filec;
DwtCompString **newfile;
{
int i;
*newfile = (char **) XtMalloc(sizeof(char *) * filec);
for (i=0;
(i<filec);
i++)
(*newfile)[i] = DwtLatin1String("ext file format");
};
static void cvtfiletoint(fs,oldfile,filec,newfile)
FileSelectionWidget fs;
DwtCompString oldfile;
int filec;
DwtCompString **newfile;
{
int i;
*newfile = (char **) XtMalloc(sizeof(char *) * filec);
for (i=0;
(i<filec);
i++)
(*newfile)[i] = DwtLatin1String("int file format");
};
int main()
{
Arg arglist[20];
int argCount = 0;
char *dirmask, *value;
int *dpy, argc=0;
char *argv[4];
struct dsc$descriptor_s temp$dsc;
{
char c[6];
int i;
sscanf("1234$","%d",&i);
sprintf(c,"%d",12345);
}
toplevel = XtInitialize("name", "class",
options, 1,
&argc, &argv);
DwtSetArg("FALSE",arglist,0,XtNiconState);
DwtSetArg("TRUE",arglist,1,XtNnoResize);
DwtSetArg("TRUE",arglist,2,XtNnoLower);
DwtSetArg("TRUE",arglist,3,XtNnoIconify);
XtSetValues(toplevel,arglist,4);
mainw = DwtMainWindow(toplevel,"main",0,0,300,300);
XtManageChild(mainw);
work = DwtDialogBoxCreate(mainw,"work",NULL,0);
XtManageChild(work);
create_fs_pb = DwtPushButton(work,
"create fs pb",
20,20,
DwtLatin1String("manage fs widget"),
manage_cb,NULL);
XtManageChild(create_fs_pb);
unmanage_pb = DwtPushButton(work,
"create fs pb",
20,40,
DwtLatin1String("unmanage fs widget"),
unmanage_cb,NULL);
XtManageChild(unmanage_pb);
create_fs_pb2 = DwtPushButton(work,
"create fs pb",
20,60,
DwtLatin1String("manage fs #2 widget"),
manage_cb2,NULL);
XtManageChild(create_fs_pb2);
setval_pb = DwtPushButton(work,
"exit fs pb",
20,80,
DwtLatin1String("SetValues"),
getval_cb,NULL);
XtManageChild(setval_pb);
setval_pb2 = DwtPushButton(work,
"exit fs pb",
20,100,
DwtLatin1String("SetValues on fs #2"),
getval_cb2,NULL);
XtManageChild(setval_pb2);
exit_fs_pb = DwtPushButton(work,
"exit fs pb",
20,120,
DwtLatin1String("exit"),
bye_bye_cb,NULL);
XtManageChild(exit_fs_pb);
argCount = 0;
XtSetArg(arglist[argCount], DwtNstyle, DwtModeless);
argCount++;
XtSetArg(arglist[argCount], DwtNdefaultPosition, TRUE);
argCount++;
XtSetArg(arglist[argCount], DwtNactivateCallback, unmanage_cb);
argCount++;
XtSetArg(arglist[argCount], DwtNcancelCallback, unmanage_cb);
argCount++;
XtSetArg(arglist[argCount], DwtNdirMask, DwtLatin1String("*.c"));
argCount++;
fileselect = DwtFileSelectionCreate(mainw,
"test file select",
arglist,
argCount);
subwork = DwtDialogBoxCreate(fileselect,"work",NULL,0);
XtManageChild(subwork);
workbutton = DwtPushButton(subwork,
"fileselection pushbutton",
0,0,
DwtLatin1String("FS button"),
NULL,NULL);
XtManageChild(workbutton);
temp$dsc.dsc$a_pointer = "test select";
temp$dsc.dsc$w_length = strlen("test select");
temp$dsc.dsc$b_dtype = DSC$K_DTYPE_T;
temp$dsc.dsc$b_class = DSC$K_CLASS_S;
fs2 = DWT$SELECTION(&mainw,
&temp$dsc,
&0,&0,
DwtLatin1String("title"),
NULL,
NULL,
&0,
&5,
&DwtModeless,
&TRUE,
NULL, NULL);
DwtMainSetAreas (mainw, NULL, work, 0, 0, 0);
XtRealizeWidget(toplevel);
XtMainLoop();
/* UNREACHABLE */
return (0);
}
|