unsupported.tcl 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. # unsupported.tcl --
  2. #
  3. # Commands provided by Tk without official support. Use them at your
  4. # own risk. They may change or go away without notice.
  5. #
  6. # See the file "license.terms" for information on usage and redistribution
  7. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  8. # ----------------------------------------------------------------------
  9. # Unsupported compatibility interface for folks accessing Tk's private
  10. # commands and variable against recommended usage.
  11. # ----------------------------------------------------------------------
  12. namespace eval ::tk::unsupported {
  13. # Map from the old global names of Tk private commands to their
  14. # new namespace-encapsulated names.
  15. variable PrivateCommands
  16. array set PrivateCommands {
  17. tkButtonAutoInvoke ::tk::ButtonAutoInvoke
  18. tkButtonDown ::tk::ButtonDown
  19. tkButtonEnter ::tk::ButtonEnter
  20. tkButtonInvoke ::tk::ButtonInvoke
  21. tkButtonLeave ::tk::ButtonLeave
  22. tkButtonUp ::tk::ButtonUp
  23. tkCancelRepeat ::tk::CancelRepeat
  24. tkCheckRadioDown ::tk::CheckRadioDown
  25. tkCheckRadioEnter ::tk::CheckRadioEnter
  26. tkCheckRadioInvoke ::tk::CheckRadioInvoke
  27. tkColorDialog ::tk::dialog::color::
  28. tkColorDialog_BuildDialog ::tk::dialog::color::BuildDialog
  29. tkColorDialog_CancelCmd ::tk::dialog::color::CancelCmd
  30. tkColorDialog_Config ::tk::dialog::color::Config
  31. tkColorDialog_CreateSelector ::tk::dialog::color::CreateSelector
  32. tkColorDialog_DrawColorScale ::tk::dialog::color::DrawColorScale
  33. tkColorDialog_EnterColorBar ::tk::dialog::color::EnterColorBar
  34. tkColorDialog_InitValues ::tk::dialog::color::InitValues
  35. tkColorDialog_HandleRGBEntry ::tk::dialog::color::HandleRGBEntry
  36. tkColorDialog_HandleSelEntry ::tk::dialog::color::HandleSelEntry
  37. tkColorDialog_LeaveColorBar ::tk::dialog::color::LeaveColorBar
  38. tkColorDialog_MoveSelector ::tk::dialog::color::MoveSelector
  39. tkColorDialog_OkCmd ::tk::dialog::color::OkCmd
  40. tkColorDialog_RedrawColorBars ::tk::dialog::color::RedrawColorBars
  41. tkColorDialog_RedrawFinalColor ::tk::dialog::color::RedrawFinalColor
  42. tkColorDialog_ReleaseMouse ::tk::dialog::color::ReleaseMouse
  43. tkColorDialog_ResizeColorBars ::tk::dialog::color::ResizeColorBars
  44. tkColorDialog_RgbToX ::tk::dialog::color::RgbToX
  45. tkColorDialog_SetRGBValue ::tk::dialog::color::SetRGBValue
  46. tkColorDialog_StartMove ::tk::dialog::color::StartMove
  47. tkColorDialog_XToRgb ::tk::dialog::color::XToRGB
  48. tkConsoleAbout ::tk::ConsoleAbout
  49. tkConsoleBind ::tk::ConsoleBind
  50. tkConsoleExit ::tk::ConsoleExit
  51. tkConsoleHistory ::tk::ConsoleHistory
  52. tkConsoleInit ::tk::ConsoleInit
  53. tkConsoleInsert ::tk::ConsoleInsert
  54. tkConsoleInvoke ::tk::ConsoleInvoke
  55. tkConsoleOutput ::tk::ConsoleOutput
  56. tkConsolePrompt ::tk::ConsolePrompt
  57. tkConsoleSource ::tk::ConsoleSource
  58. tkDarken ::tk::Darken
  59. tkEntryAutoScan ::tk::EntryAutoScan
  60. tkEntryBackspace ::tk::EntryBackspace
  61. tkEntryButton1 ::tk::EntryButton1
  62. tkEntryClosestGap ::tk::EntryClosestGap
  63. tkEntryGetSelection ::tk::EntryGetSelection
  64. tkEntryInsert ::tk::EntryInsert
  65. tkEntryKeySelect ::tk::EntryKeySelect
  66. tkEntryMouseSelect ::tk::EntryMouseSelect
  67. tkEntryNextWord ::tk::EntryNextWord
  68. tkEntryPaste ::tk::EntryPaste
  69. tkEntryPreviousWord ::tk::EntryPreviousWord
  70. tkEntrySeeInsert ::tk::EntrySeeInsert
  71. tkEntrySetCursor ::tk::EntrySetCursor
  72. tkEntryTranspose ::tk::EntryTranspose
  73. tkEventMotifBindings ::tk::EventMotifBindings
  74. tkFDGetFileTypes ::tk::FDGetFileTypes
  75. tkFirstMenu ::tk::FirstMenu
  76. tkFocusGroup_BindIn ::tk::FocusGroup_BindIn
  77. tkFocusGroup_BindOut ::tk::FocusGroup_BindOut
  78. tkFocusGroup_Create ::tk::FocusGroup_Create
  79. tkFocusGroup_Destroy ::tk::FocusGroup_Destroy
  80. tkFocusGroup_In ::tk::FocusGroup_In
  81. tkFocusGroup_Out ::tk::FocusGroup_Out
  82. tkFocusOK ::tk::FocusOK
  83. tkGenerateMenuSelect ::tk::GenerateMenuSelect
  84. tkIconList ::tk::IconList
  85. tkListbox ::tk::Listbox
  86. tkListboxAutoScan ::tk::ListboxAutoScan
  87. tkListboxBeginExtend ::tk::ListboxBeginExtend
  88. tkListboxBeginSelect ::tk::ListboxBeginSelect
  89. tkListboxBeginToggle ::tk::ListboxBeginToggle
  90. tkListboxCancel ::tk::ListboxCancel
  91. tkListboxDataExtend ::tk::ListboxDataExtend
  92. tkListboxExtendUpDown ::tk::ListboxExtendUpDown
  93. tkListboxKeyAccel_Goto ::tk::ListboxKeyAccel_Goto
  94. tkListboxKeyAccel_Key ::tk::ListboxKeyAccel_Key
  95. tkListboxKeyAccel_Reset ::tk::ListboxKeyAccel_Reset
  96. tkListboxKeyAccel_Set ::tk::ListboxKeyAccel_Set
  97. tkListboxKeyAccel_Unset ::tk::ListboxKeyAccel_Unxet
  98. tkListboxMotion ::tk::ListboxMotion
  99. tkListboxSelectAll ::tk::ListboxSelectAll
  100. tkListboxUpDown ::tk::ListboxUpDown
  101. tkListboxBeginToggle ::tk::ListboxBeginToggle
  102. tkMbButtonUp ::tk::MbButtonUp
  103. tkMbEnter ::tk::MbEnter
  104. tkMbLeave ::tk::MbLeave
  105. tkMbMotion ::tk::MbMotion
  106. tkMbPost ::tk::MbPost
  107. tkMenuButtonDown ::tk::MenuButtonDown
  108. tkMenuDownArrow ::tk::MenuDownArrow
  109. tkMenuDup ::tk::MenuDup
  110. tkMenuEscape ::tk::MenuEscape
  111. tkMenuFind ::tk::MenuFind
  112. tkMenuFindName ::tk::MenuFindName
  113. tkMenuFirstEntry ::tk::MenuFirstEntry
  114. tkMenuInvoke ::tk::MenuInvoke
  115. tkMenuLeave ::tk::MenuLeave
  116. tkMenuLeftArrow ::tk::MenuLeftArrow
  117. tkMenuMotion ::tk::MenuMotion
  118. tkMenuNextEntry ::tk::MenuNextEntry
  119. tkMenuNextMenu ::tk::MenuNextMenu
  120. tkMenuRightArrow ::tk::MenuRightArrow
  121. tkMenuUnpost ::tk::MenuUnpost
  122. tkMenuUpArrow ::tk::MenuUpArrow
  123. tkMessageBox ::tk::MessageBox
  124. tkMotifFDialog ::tk::MotifFDialog
  125. tkMotifFDialog_ActivateDList ::tk::MotifFDialog_ActivateDList
  126. tkMotifFDialog_ActivateFList ::tk::MotifFDialog_ActivateFList
  127. tkMotifFDialog_ActivateFEnt ::tk::MotifFDialog_ActivateFEnt
  128. tkMotifFDialog_ActivateSEnt ::tk::MotifFDialog_ActivateSEnt
  129. tkMotifFDialog ::tk::MotifFDialog
  130. tkMotifFDialog_BrowseDList ::tk::MotifFDialog_BrowseDList
  131. tkMotifFDialog_BrowseFList ::tk::MotifFDialog_BrowseFList
  132. tkMotifFDialog_BuildUI ::tk::MotifFDialog_BuildUI
  133. tkMotifFDialog_CancelCmd ::tk::MotifFDialog_CancelCmd
  134. tkMotifFDialog_Config ::tk::MotifFDialog_Config
  135. tkMotifFDialog_Create ::tk::MotifFDialog_Create
  136. tkMotifFDialog_FileTypes ::tk::MotifFDialog_FileTypes
  137. tkMotifFDialog_FilterCmd ::tk::MotifFDialog_FilterCmd
  138. tkMotifFDialog_InterpFilter ::tk::MotifFDialog_InterpFilter
  139. tkMotifFDialog_LoadFiles ::tk::MotifFDialog_LoadFiles
  140. tkMotifFDialog_MakeSList ::tk::MotifFDialog_MakeSList
  141. tkMotifFDialog_OkCmd ::tk::MotifFDialog_OkCmd
  142. tkMotifFDialog_SetFilter ::tk::MotifFDialog_SetFilter
  143. tkMotifFDialog_SetListMode ::tk::MotifFDialog_SetListMode
  144. tkMotifFDialog_Update ::tk::MotifFDialog_Update
  145. tkPostOverPoint ::tk::PostOverPoint
  146. tkRecolorTree ::tk::RecolorTree
  147. tkRestoreOldGrab ::tk::RestoreOldGrab
  148. tkSaveGrabInfo ::tk::SaveGrabInfo
  149. tkScaleActivate ::tk::ScaleActivate
  150. tkScaleButtonDown ::tk::ScaleButtonDown
  151. tkScaleButton2Down ::tk::ScaleButton2Down
  152. tkScaleControlPress ::tk::ScaleControlPress
  153. tkScaleDrag ::tk::ScaleDrag
  154. tkScaleEndDrag ::tk::ScaleEndDrag
  155. tkScaleIncrement ::tk::ScaleIncrement
  156. tkScreenChanged ::tk::ScreenChanged
  157. tkScrollButtonDown ::tk::ScrollButtonDown
  158. tkScrollButton2Down ::tk::ScrollButton2Down
  159. tkScrollButtonDrag ::tk::ScrollButtonDrag
  160. tkScrollButtonUp ::tk::ScrollButtonUp
  161. tkScrollByPages ::tk::ScrollByPages
  162. tkScrollByUnits ::tk::ScrollByUnits
  163. tkScrollEndDrag ::tk::ScrollEndDrag
  164. tkScrollSelect ::tk::ScrollSelect
  165. tkScrollStartDrag ::tk::ScrollStartDrag
  166. tkScrollTopBottom ::tk::ScrollTopBottom
  167. tkScrollToPos ::tk::ScrollToPos
  168. tkTabToWindow ::tk::TabToWindow
  169. tkTearOffMenu ::tk::TearOffMenu
  170. tkTextAutoScan ::tk::TextAutoScan
  171. tkTextButton1 ::tk::TextButton1
  172. tkTextClosestGap ::tk::TextClosestGap
  173. tkTextInsert ::tk::TextInsert
  174. tkTextKeyExtend ::tk::TextKeyExtend
  175. tkTextKeySelect ::tk::TextKeySelect
  176. tkTextNextPara ::tk::TextNextPara
  177. tkTextNextPos ::tk::TextNextPos
  178. tkTextNextWord ::tk::TextNextWord
  179. tkTextPaste ::tk::TextPaste
  180. tkTextPrevPara ::tk::TextPrevPara
  181. tkTextPrevPos ::tk::TextPrevPos
  182. tkTextPrevWord ::tk::TextPrevWord
  183. tkTextResetAnchor ::tk::TextResetAnchor
  184. tkTextScrollPages ::tk::TextScrollPages
  185. tkTextSelectTo ::tk::TextSelectTo
  186. tkTextSetCursor ::tk::TextSetCursor
  187. tkTextTranspose ::tk::TextTranspose
  188. tkTextUpDownLine ::tk::TextUpDownLine
  189. tkTraverseToMenu ::tk::TraverseToMenu
  190. tkTraverseWithinMenu ::tk::TraverseWithinMenu
  191. unsupported1 ::tk::unsupported::MacWindowStyle
  192. }
  193. # Map from the old global names of Tk private variable to their
  194. # new namespace-encapsulated names.
  195. variable PrivateVariables
  196. array set PrivateVariables {
  197. droped_to_start ::tk::mac::Droped_to_start
  198. histNum ::tk::HistNum
  199. stub_location ::tk::mac::Stub_location
  200. tkFocusIn ::tk::FocusIn
  201. tkFocusOut ::tk::FocusOut
  202. tkPalette ::tk::Palette
  203. tkPriv ::tk::Priv
  204. tkPrivMsgBox ::tk::PrivMsgBox
  205. }
  206. }
  207. # ::tk::unsupported::ExposePrivateCommand --
  208. #
  209. # Expose one of Tk's private commands to be visible under its
  210. # old global name
  211. #
  212. # Arguments:
  213. # cmd Global name by which the command was once known,
  214. # or a glob-style pattern.
  215. #
  216. # Results:
  217. # None.
  218. #
  219. # Side effects:
  220. # The old command name in the global namespace is aliased to the
  221. # new private name.
  222. proc ::tk::unsupported::ExposePrivateCommand {cmd} {
  223. variable PrivateCommands
  224. set cmds [array get PrivateCommands $cmd]
  225. if {[llength $cmds] == 0} {
  226. return -code error -errorcode {TK EXPOSE_PRIVATE_COMMAND} \
  227. "No compatibility support for \[$cmd]"
  228. }
  229. foreach {old new} $cmds {
  230. namespace eval :: [list interp alias {} $old {}] $new
  231. }
  232. }
  233. # ::tk::unsupported::ExposePrivateVariable --
  234. #
  235. # Expose one of Tk's private variables to be visible under its
  236. # old global name
  237. #
  238. # Arguments:
  239. # var Global name by which the variable was once known,
  240. # or a glob-style pattern.
  241. #
  242. # Results:
  243. # None.
  244. #
  245. # Side effects:
  246. # The old variable name in the global namespace is aliased to the
  247. # new private name.
  248. proc ::tk::unsupported::ExposePrivateVariable {var} {
  249. variable PrivateVariables
  250. set vars [array get PrivateVariables $var]
  251. if {[llength $vars] == 0} {
  252. return -code error -errorcode {TK EXPOSE_PRIVATE_VARIABLE} \
  253. "No compatibility support for \$$var"
  254. }
  255. namespace eval ::tk::mac {}
  256. foreach {old new} $vars {
  257. namespace eval :: [list upvar "#0" $new $old]
  258. }
  259. }