How do I author a new widget in C?

Original JO book remains best explanation.

General topic of working with Tcl in C, including pertinent chapters [2 ] [1 ] from Brent Welch book Book Practical Programming in Tcl and Tk. Notice correct emphasis on distinction between C source and its construction.

Clif's book.

Very important: generic/tkSquare.c example