unsupported.tcl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. tkIconList_Add ::tk::IconList_Add
  86. tkIconList_Arrange ::tk::IconList_Arrange
  87. tkIconList_AutoScan ::tk::IconList_AutoScan
  88. tkIconList_Btn1 ::tk::IconList_Btn1
  89. tkIconList_Config ::tk::IconList_Config
  90. tkIconList_Create ::tk::IconList_Create
  91. tkIconList_CtrlBtn1 ::tk::IconList_CtrlBtn1
  92. tkIconList_Curselection ::tk::IconList_CurSelection
  93. tkIconList_DeleteAll ::tk::IconList_DeleteAll
  94. tkIconList_Double1 ::tk::IconList_Double1
  95. tkIconList_DrawSelection ::tk::IconList_DrawSelection
  96. tkIconList_FocusIn ::tk::IconList_FocusIn
  97. tkIconList_FocusOut ::tk::IconList_FocusOut
  98. tkIconList_Get ::tk::IconList_Get
  99. tkIconList_Goto ::tk::IconList_Goto
  100. tkIconList_Index ::tk::IconList_Index
  101. tkIconList_Invoke ::tk::IconList_Invoke
  102. tkIconList_KeyPress ::tk::IconList_KeyPress
  103. tkIconList_Leave1 ::tk::IconList_Leave1
  104. tkIconList_LeftRight ::tk::IconList_LeftRight
  105. tkIconList_Motion1 ::tk::IconList_Motion1
  106. tkIconList_Reset ::tk::IconList_Reset
  107. tkIconList_ReturnKey ::tk::IconList_ReturnKey
  108. tkIconList_See ::tk::IconList_See
  109. tkIconList_Select ::tk::IconList_Select
  110. tkIconList_Selection ::tk::IconList_Selection
  111. tkIconList_ShiftBtn1 ::tk::IconList_ShiftBtn1
  112. tkIconList_UpDown ::tk::IconList_UpDown
  113. tkListbox ::tk::Listbox
  114. tkListboxAutoScan ::tk::ListboxAutoScan
  115. tkListboxBeginExtend ::tk::ListboxBeginExtend
  116. tkListboxBeginSelect ::tk::ListboxBeginSelect
  117. tkListboxBeginToggle ::tk::ListboxBeginToggle
  118. tkListboxCancel ::tk::ListboxCancel
  119. tkListboxDataExtend ::tk::ListboxDataExtend
  120. tkListboxExtendUpDown ::tk::ListboxExtendUpDown
  121. tkListboxKeyAccel_Goto ::tk::ListboxKeyAccel_Goto
  122. tkListboxKeyAccel_Key ::tk::ListboxKeyAccel_Key
  123. tkListboxKeyAccel_Reset ::tk::ListboxKeyAccel_Reset
  124. tkListboxKeyAccel_Set ::tk::ListboxKeyAccel_Set
  125. tkListboxKeyAccel_Unset ::tk::ListboxKeyAccel_Unxet
  126. tkListboxMotion ::tk::ListboxMotion
  127. tkListboxSelectAll ::tk::ListboxSelectAll
  128. tkListboxUpDown ::tk::ListboxUpDown
  129. tkListboxBeginToggle ::tk::ListboxBeginToggle
  130. tkMbButtonUp ::tk::MbButtonUp
  131. tkMbEnter ::tk::MbEnter
  132. tkMbLeave ::tk::MbLeave
  133. tkMbMotion ::tk::MbMotion
  134. tkMbPost ::tk::MbPost
  135. tkMenuButtonDown ::tk::MenuButtonDown
  136. tkMenuDownArrow ::tk::MenuDownArrow
  137. tkMenuDup ::tk::MenuDup
  138. tkMenuEscape ::tk::MenuEscape
  139. tkMenuFind ::tk::MenuFind
  140. tkMenuFindName ::tk::MenuFindName
  141. tkMenuFirstEntry ::tk::MenuFirstEntry
  142. tkMenuInvoke ::tk::MenuInvoke
  143. tkMenuLeave ::tk::MenuLeave
  144. tkMenuLeftArrow ::tk::MenuLeftArrow
  145. tkMenuMotion ::tk::MenuMotion
  146. tkMenuNextEntry ::tk::MenuNextEntry
  147. tkMenuNextMenu ::tk::MenuNextMenu
  148. tkMenuRightArrow ::tk::MenuRightArrow
  149. tkMenuUnpost ::tk::MenuUnpost
  150. tkMenuUpArrow ::tk::MenuUpArrow
  151. tkMessageBox ::tk::MessageBox
  152. tkMotifFDialog ::tk::MotifFDialog
  153. tkMotifFDialog_ActivateDList ::tk::MotifFDialog_ActivateDList
  154. tkMotifFDialog_ActivateFList ::tk::MotifFDialog_ActivateFList
  155. tkMotifFDialog_ActivateFEnt ::tk::MotifFDialog_ActivateFEnt
  156. tkMotifFDialog_ActivateSEnt ::tk::MotifFDialog_ActivateSEnt
  157. tkMotifFDialog ::tk::MotifFDialog
  158. tkMotifFDialog_BrowseDList ::tk::MotifFDialog_BrowseDList
  159. tkMotifFDialog_BrowseFList ::tk::MotifFDialog_BrowseFList
  160. tkMotifFDialog_BuildUI ::tk::MotifFDialog_BuildUI
  161. tkMotifFDialog_CancelCmd ::tk::MotifFDialog_CancelCmd
  162. tkMotifFDialog_Config ::tk::MotifFDialog_Config
  163. tkMotifFDialog_Create ::tk::MotifFDialog_Create
  164. tkMotifFDialog_FileTypes ::tk::MotifFDialog_FileTypes
  165. tkMotifFDialog_FilterCmd ::tk::MotifFDialog_FilterCmd
  166. tkMotifFDialog_InterpFilter ::tk::MotifFDialog_InterpFilter
  167. tkMotifFDialog_LoadFiles ::tk::MotifFDialog_LoadFiles
  168. tkMotifFDialog_MakeSList ::tk::MotifFDialog_MakeSList
  169. tkMotifFDialog_OkCmd ::tk::MotifFDialog_OkCmd
  170. tkMotifFDialog_SetFilter ::tk::MotifFDialog_SetFilter
  171. tkMotifFDialog_SetListMode ::tk::MotifFDialog_SetListMode
  172. tkMotifFDialog_Update ::tk::MotifFDialog_Update
  173. tkPostOverPoint ::tk::PostOverPoint
  174. tkRecolorTree ::tk::RecolorTree
  175. tkRestoreOldGrab ::tk::RestoreOldGrab
  176. tkSaveGrabInfo ::tk::SaveGrabInfo
  177. tkScaleActivate ::tk::ScaleActivate
  178. tkScaleButtonDown ::tk::ScaleButtonDown
  179. tkScaleButton2Down ::tk::ScaleButton2Down
  180. tkScaleControlPress ::tk::ScaleControlPress
  181. tkScaleDrag ::tk::ScaleDrag
  182. tkScaleEndDrag ::tk::ScaleEndDrag
  183. tkScaleIncrement ::tk::ScaleIncrement
  184. tkScreenChanged ::tk::ScreenChanged
  185. tkScrollButtonDown ::tk::ScrollButtonDown
  186. tkScrollButton2Down ::tk::ScrollButton2Down
  187. tkScrollButtonDrag ::tk::ScrollButtonDrag
  188. tkScrollButtonUp ::tk::ScrollButtonUp
  189. tkScrollByPages ::tk::ScrollByPages
  190. tkScrollByUnits ::tk::ScrollByUnits
  191. tkScrollEndDrag ::tk::ScrollEndDrag
  192. tkScrollSelect ::tk::ScrollSelect
  193. tkScrollStartDrag ::tk::ScrollStartDrag
  194. tkScrollTopBottom ::tk::ScrollTopBottom
  195. tkScrollToPos ::tk::ScrollToPos
  196. tkTabToWindow ::tk::TabToWindow
  197. tkTearOffMenu ::tk::TearOffMenu
  198. tkTextAutoScan ::tk::TextAutoScan
  199. tkTextButton1 ::tk::TextButton1
  200. tkTextClosestGap ::tk::TextClosestGap
  201. tkTextInsert ::tk::TextInsert
  202. tkTextKeyExtend ::tk::TextKeyExtend
  203. tkTextKeySelect ::tk::TextKeySelect
  204. tkTextNextPara ::tk::TextNextPara
  205. tkTextNextPos ::tk::TextNextPos
  206. tkTextNextWord ::tk::TextNextWord
  207. tkTextPaste ::tk::TextPaste
  208. tkTextPrevPara ::tk::TextPrevPara
  209. tkTextPrevPos ::tk::TextPrevPos
  210. tkTextPrevWord ::tk::TextPrevWord
  211. tkTextResetAnchor ::tk::TextResetAnchor
  212. tkTextScrollPages ::tk::TextScrollPages
  213. tkTextSelectTo ::tk::TextSelectTo
  214. tkTextSetCursor ::tk::TextSetCursor
  215. tkTextTranspose ::tk::TextTranspose
  216. tkTextUpDownLine ::tk::TextUpDownLine
  217. tkTraverseToMenu ::tk::TraverseToMenu
  218. tkTraverseWithinMenu ::tk::TraverseWithinMenu
  219. unsupported1 ::tk::unsupported::MacWindowStyle
  220. }
  221. # Map from the old global names of Tk private variable to their
  222. # new namespace-encapsulated names.
  223. variable PrivateVariables
  224. array set PrivateVariables {
  225. droped_to_start ::tk::mac::Droped_to_start
  226. histNum ::tk::HistNum
  227. stub_location ::tk::mac::Stub_location
  228. tkFocusIn ::tk::FocusIn
  229. tkFocusOut ::tk::FocusOut
  230. tkPalette ::tk::Palette
  231. tkPriv ::tk::Priv
  232. tkPrivMsgBox ::tk::PrivMsgBox
  233. }
  234. }
  235. # ::tk::unsupported::ExposePrivateCommand --
  236. #
  237. # Expose one of Tk's private commands to be visible under its
  238. # old global name
  239. #
  240. # Arguments:
  241. # cmd Global name by which the command was once known,
  242. # or a glob-style pattern.
  243. #
  244. # Results:
  245. # None.
  246. #
  247. # Side effects:
  248. # The old command name in the global namespace is aliased to the
  249. # new private name.
  250. proc ::tk::unsupported::ExposePrivateCommand {cmd} {
  251. variable PrivateCommands
  252. set cmds [array get PrivateCommands $cmd]
  253. if {[llength $cmds] == 0} {
  254. return -code error "No compatibility support for \[$cmd]"
  255. }
  256. foreach {old new} $cmds {
  257. namespace eval :: [list interp alias {} $old {}] $new
  258. }
  259. }
  260. # ::tk::unsupported::ExposePrivateVariable --
  261. #
  262. # Expose one of Tk's private variables to be visible under its
  263. # old global name
  264. #
  265. # Arguments:
  266. # var Global name by which the variable was once known,
  267. # or a glob-style pattern.
  268. #
  269. # Results:
  270. # None.
  271. #
  272. # Side effects:
  273. # The old variable name in the global namespace is aliased to the
  274. # new private name.
  275. proc ::tk::unsupported::ExposePrivateVariable {var} {
  276. variable PrivateVariables
  277. set vars [array get PrivateVariables $var]
  278. if {[llength $vars] == 0} {
  279. return -code error "No compatibility support for \$$var"
  280. }
  281. namespace eval ::tk::mac {}
  282. foreach {old new} $vars {
  283. namespace eval :: [list upvar "#0" $new $old]
  284. }
  285. }