For some straightforward examples, take a look at the current Commands & Colors: Napoleonics module (v3.42).
There are 3 GPIWs defined. From the main toolbar, these are under buttons “?In Hands” and two ?Count buttons (one for terrain and the other for units). In the editor, you will find the definitions for these near the end of the module.