|
Most people consider the WPObjData class a nuisance, but it is actually one of the handiest WPS utilities available. With it, you can create "settings objects" that will set the properties of other WPS objects dropped on them. It's easy to use and far more powerful than the REXX SysSetObjectData function because it works with any class of object.
As supplied with the WPS Feature Installer (used to install, e.g., Java 1.1.x.), WPObjData is a nuisance because it hijacks your data files. They acquire its "hammer and screwdriver" icon and open their notebooks when double-clicked. Many users eliminate this annoyance by simply deregistering the class, then rebooting. Everything, including the Feature Installer, continues to work properly.
However, you can fix this bug in WPObjData and put it to work for you by making a simple change in the dll containing the class (x:\OS2\DLL\OBJDATA.DLL). This change will associate the class with files whose .TYPE is "ObjectData", rather than "Plain Text".
To create a WPObjData object, open your Templates folder and look for the one with the "hammer and screwdriver" icon. It is probably titled "Data File:1". Drag a copy to the Desktop to create a new object that is actually an empty file of .TYPE "ObjectData". Associate your favorite text editor with this type to make it the default editor.
To set up a WPObjData object, open it in a text editor. Enter WPS setup strings, one per line, then save the file. For example, this sets a folder's default view to Icon and causes it to show all objects in Tree view:
DEFAULTVIEW=1 SHOWALLINTREEVIEW=YES
Click here for a complete listing of setup strings for common object classes, along with a list of the values used to select an object's default view.
To use a WPObjData object, drop another object on it. The setup strings that are recognized by the dropped object's class will be used and those properties set. Strings that are meaningless to the object will be ignored.
When using WPObjData, there are a few things you should be aware of:
The information contained in this article is largely the result of experimentation. There may be some inaccuracies, and future releases of the Feature Installer may change WPObjData's operation. Readers' corrections and updates will be appreciated.
Rich Walsh is a freelance programmer and author of the several utilities, including DragText.
Copyright © 1998 - Falcon Networking | ISSN 1203-5696 |