Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!snorkelwacker!bloom-beacon!EXPO.LCS.MIT.EDU!kit From: kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) Newsgroups: comp.windows.x Subject: Re: How do you set widget fonts with XtSetArg? Message-ID: <9006291514.AA28226@expo.lcs.mit.edu> Date: 29 Jun 90 15:14:51 GMT References: Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 50 > First of all, I would like to apologize for the butchered version > of my previous posting asking for help with the ascii Text Widget. > As of now, the question still remains as to how one may go about > saving the contents of the ascii Text widget. Any suggestions? If you are using R4, then RTFM. Athena widget's section 5.6.2.1. XawAsciiSaveAsFile() is probabally exactly what you want. Unfortunatly your message is sufficiently vague that I cannot be sure which verion of X you are using, or wher you are trying to save the contents. > i = 0; > XtSetArg(args[i], XtNfont, ?????); i++; > XtSetValues(label_widget, args, i); > But what belongs in the ???????. What belongs here is a valid X Font Structure. The thing returned from XQueryLoadFont() (Or is is XLoadQueryFont, I can never remember). A MUCH better solution is to put the font specification in the applications app-default file, this is not only simplier, but more portable. Remember that fonts are inherently non-portable, since I may not have the same fonts on my X Terminal that you have on your workstation, or whatever. In an app-default file you can just add the line: *label_widget_name: The Font name is either something like 6x10, or 9x15 or an XLFD name such as: -adobe-helvetica-bold-o-normal--24-240-75-75-p-138-iso8859-1 or -*-helvetica-bold-o-normal--*-240-*-*-*-*-iso8859-1 The latter is better since it is resolution independent, but in either case if the user doesn't have this font on his system he can just override it with one that he does have, it may not look as nice, but at least the application will work. If you hard-code the font value in with XtSetValues, and I don't have that font then your application is instantly useless. Chris D. Peterson MIT X Consortium Net: kit@expo.lcs.mit.edu Phone: (617) 253 - 9608 Address: MIT - Room NE43-213