If you've ever customized your .Xresources file, then you already know a lot of what you need for Motif programming. If you haven't learned about X resources, you should first look in the Athena OLC stock answers, because we won't cover that material in this course. X WINDOW SYSTEM Answers How to use X RESOURCES Let's look at how you can create the layout of a Motif application entirely in X resources. Type the following at the athena% prompt: setup wcl A new xterm will appear, giving you a wcl% prompt. At the wcl% prompt, type the following commands: cd /mit/wcl/app-defaults Mri -rf Mri/Demo & You'll get a window with a stack of buttons. Try clicking the top one, "Hello". A window will pop up that might look like the first X-windows program you ever wrote. In your xterm window you'll see something like wcl% Wcl loaded: Mri/Hello Take a look at that file (type "more Mri/Hello"). Ignore the lines beginning with `!'; they're just comments. "Hello World" is just four X resources. The first resource tells Mri to create one widget: "push" The next line says that "push" should be a Motif PushButton. If you want lots of gory details, type "man XmPushButton" (the capital letters are important). The third line puts a label on the PushButton. The fourth line tells what to do when the button is clicked on. Take a few minutes to browse through the other demo programs, particularly PerTem. Next, I will give you an example of how to write a mockup of your own application in X resources with Mri. Type pushd /mit/wcl/doc/iap/day1 more Week