The -typevariable option is buggy in X11. According to TIP 242 the typevariable should hold the type as specified. This script:
package require tcltest
package require Tk
puts [tk_getSaveFile -initialfile foo -typevariable seltype -filetypes {{TEXT *.txt}}]
puts $seltype
# behaviour before the patch
# Win: TEXT
# Tk/Carbon: TEXT
# Tk/Cocoa: seltype is undefined
# X11: TEXT (*.txt)
#
# after the patch
# X11: TEXT
gives the expected output under Win and Tk/Carbon. The modified result in X11 prevents the use case of switching on the value of typevariable. The attached patch fixes the problem for X11.
Patch for typevariable bug in X11
See also bug 3588462