One of the nice features of the X Toolkit is that it does provide a simple interface to a powerful feature and this simple interface does cut down on programming errors. Still, mistakes are common. In this column, I will look at the most common resource syntax errors, ways to avoid the errors, and ways to debug them. By reading this material, you should learn how to identify resource syntax errors in your code, either when writing the code or later when debugging it. Hopefully, you'll be able to go one step further, as well.
Defensive code uses extensive error checking to discover bugs early in the development cycle.
We'll look at ways to do this with your resource-handling code. Function Calls You can set and get X Toolkit widget resources through a number of different functions, but the general syntax of all the calls is similar. Let's look at each of them. The widget ID is probably the hardest argument to get wrong. Immediately using this value is unlikely to lead to problems.