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 [L1 ] [L2 ] 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