diff options
-rw-r--r-- | generic/tkCmds.c | 10 | ||||
-rw-r--r-- | library/tk.tcl | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/generic/tkCmds.c b/generic/tkCmds.c index e652740..4fb06b2 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -60,6 +60,7 @@ MODULE_SCOPE const TkEnsemble tkFontchooserEnsemble[]; */ static const TkEnsemble tkCmdMap[] = { + {"fontchooser", NULL, tkFontchooserEnsemble}, {"appname", AppnameCmd, NULL }, {"busy", Tk_BusyObjCmd, NULL }, {"caret", CaretCmd, NULL }, @@ -67,7 +68,6 @@ static const TkEnsemble tkCmdMap[] = { {"scaling", ScalingCmd, NULL }, {"useinputmethods", UseinputmethodsCmd, NULL }, {"windowingsystem", WindowingsystemCmd, NULL }, - {"fontchooser", NULL, tkFontchooserEnsemble}, {NULL, NULL, NULL} }; @@ -650,9 +650,13 @@ TkInitTkCmd( Tcl_Interp *interp, ClientData clientData) { - TkMakeEnsemble(interp, "::", "tk", clientData, tkCmdMap); + /* If the interp is safe, leave out "fontchooser" */ + int isSafe = Tcl_IsSafe(interp); + TkMakeEnsemble(interp, "::", "tk", clientData, tkCmdMap + isSafe); #if defined(_WIN32) || defined(MAC_OSX_TK) - TkInitFontchooser(interp, clientData); + if (!isSafe) { + TkInitFontchooser(interp, clientData); + } #endif return TCL_OK; } diff --git a/library/tk.tcl b/library/tk.tcl index 7a70f21..0ef1d20 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -507,7 +507,9 @@ if {$::tk_library ne ""} { SourceLibFile scale SourceLibFile scrlbar SourceLibFile spinbox - SourceLibFile systray + if {![interp issafe]} { + SourceLibFile systray + } SourceLibFile text } } |