The HTML widget uses lots of TCL callback routines. But a TCL callback can do nasty things. For example, a TCL callback could delete the HTML widget that invoked the callback. Or it could delete the TCL interpreter in which the HTML widget is running. So we have to call HtmlLock() before invoking a TCL callback and check to make sure the widget was not deleted before using any fields in the widget structure after the callback runs. The following routines can call TCL callbacks, either directly or indirectly: HtmlTokenizerAppend() HtmlParseCmd() HtmlWidgetCommand() HtmlGetImage() HtmlAddStyle() HtmlParseCmd()... HtmlSizer() HtmlLayout() HtmlRedrawCallback() GetLinkColor() HtmlAddStyle()... HtmlCallResolver() HtmlGetImage()... HtmlResolveCmd() HtmlWidgetCommand() HtmlRedrawCallback()... HtmlGetFont() DrawSelectionBackground() HtmlBlockDraw()... HtmlBlockDraw() HtmlRedrawCallback() FindIndexInBlock() DecodeBaseIndex() HtmlGetIndex() HtmlIndexCmd() HtmlWidgetCommand()... HtmlSelectionSetCmd() HtmlWidgetCommand()... HtmlInsertCmd() HtmlWidgetCommand()... Paragraph() DoBreakMarkup() HtmlLayoutBlock() HtmlLayout()... HtmlTableLayout() DoBreakMarkup()... HtmlDeleteControls() HtmlClear() HtmlWidgetCommand()... HtmlDestroyWidget()