unsupported.tcl
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:11k
源码类别:

通讯编程

开发平台:

Visual C++

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