This chapter walks you through the steps in creating a Motif widget. It focuses on a demonstration widget named ExmSimple. While not an officially released widget, the ExmSimple widget does follow the same guidelines used to write standard Motif widgets. Furthermore, this example widget provides an excellent opportunity for you to study the inner workings of widgets. You can find the source code ExmSimple and the other sample C widgets in the demos/widgets/Exm/lib directory.
In this chapter, we focus more on the big picture of writing widgets than on the fine details of perfecting them. (Later chapters provide these details.) For now, this chapter focuses on producing a working widget, albeit a rather simple one.
This chapter also includes general information on writing multithread-safe widgets.