Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!SCUBED.ARPA!warner%s3snorkel From: warner%s3snorkel@SCUBED.ARPA (Ken Warner) Newsgroups: comp.windows.x Subject: dialog widget miscellany Message-ID: <8805010211.AA05232@s3snorkel> Date: 1 May 88 02:11:57 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 92 On page 31 of X Toolkit Widgets there is documented a function called XtDialogCreate()...there is no such animal in libX11.a or libXaw.a. There is no font resource for the Dialog Widget or for buttons; am I correct? Will there be? Does anyone have any spiffy buttons. Buttons with round ends or radio buttons? Lastly, I noticed that when resizing a widget that contained other widgets and labels that the bitmap representing the label became distorted. At first I thought that the font had somehow been changed but then found there is no font resource. I think there is a counting error during resizing that affects the bitmap, thereby distorting the label. Below is the program I was foolin' around with. Compile in the usual way and resize it a few times. Did the appearance of the labels change for you? -------------------------------------------------------------------------------- #include #include #include #include #include #include void Callback(widget,clientData,callData) Widget widget; caddr_t clientData,callData; { (void)printf("Goodbye, cruel world\n"); exit(); } void SecondCallback(widget,clientData,callData) Widget widget; caddr_t clientData,callData; { (void)printf("Big Button\n"); exit(); } void ThirdCallback(widget,clientData,callData) Widget widget; caddr_t clientData,callData; { (void)printf("Little Button\n"); exit(); } int main(argc,argv) int argc; char **argv; { Widget toplevel,box,dialog_box,dialog,label,command; Widget XtDialogCreate(),Xtinitialize(),XtCreateManagedWidget(); Arg arg[25]; unsigned int n; toplevel = XtInitialize("goodbye","Goodby",NULL,0,&argc,argv); box = XtCreateManagedWidget("box",formWidgetClass,toplevel,(Arg *)NULL,0); /*XtDialogCreate(dialog_box,"dialog_box","foo-bar",(Arg *)NULL,0);*/ n = 0; XtSetArg(arg[n],XtNx,10); n++; XtSetArg(arg[n],XtNy,10); n++; XtSetArg(arg[n],XtNlabel,"Goodby, world"); n++; label = XtCreateManagedWidget("label",labelWidgetClass,box,arg,n); n = 0; XtSetArg(arg[n],XtNx,10); n++; XtSetArg(arg[n],XtNy,40); n++; XtSetArg(arg[n],XtNfromVert,label); n++; XtSetArg(arg[n],XtNvertDistance,10); n++; XtSetArg(arg[n],XtNlabel,"Click and die"); n++; command = XtCreateManagedWidget("command",commandWidgetClass,box,arg,n); XtAddCallback(command,XtNcallback,Callback,NULL); n = 0; XtSetArg(arg[n],XtNx,10); n++; XtSetArg(arg[n],XtNy,110); n++; XtSetArg(arg[n],XtNlabel,"Dialog Box"); n++; XtSetArg(arg[n],XtNwidth,50); n++; XtSetArg(arg[n],XtNfromVert,command); n++; XtSetArg(arg[n],XtNvertDistance,10); n++; XtSetArg(arg[n],XtNvalue,"Some Value"); n++; dialog = XtCreateManagedWidget("dialog",dialogWidgetClass,box,arg,n); XtDialogAddButton(dialog,"Big Button",SecondCallback,NULL); XtDialogAddButton(dialog,"Little Button",ThirdCallback,NULL); XtRealizeWidget(toplevel); XtMainLoop(); }