diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1999-12-19 00:06:52 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1999-12-19 00:06:52 (GMT) |
commit | e9c69bc53e915699dc62df7fca0824f95f6b3f45 (patch) | |
tree | 0257b43431b4673a26e87cabe22a46f7b02f10b1 | |
parent | 1f9249cea92082a478c611c5762cf48b5752ccaf (diff) | |
download | cpython-e9c69bc53e915699dc62df7fca0824f95f6b3f45.zip cpython-e9c69bc53e915699dc62df7fca0824f95f6b3f45.tar.gz cpython-e9c69bc53e915699dc62df7fca0824f95f6b3f45.tar.bz2 |
Support keys that have a Handle as parameter, by using the new GetControlDataHandle and SetControlDataHandle methods.
-rw-r--r-- | Mac/Lib/lib-toolbox/ControlAccessor.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Mac/Lib/lib-toolbox/ControlAccessor.py b/Mac/Lib/lib-toolbox/ControlAccessor.py index d3952f7..93805ab 100644 --- a/Mac/Lib/lib-toolbox/ControlAccessor.py +++ b/Mac/Lib/lib-toolbox/ControlAccessor.py @@ -3,13 +3,31 @@ from Controls import * import struct +# These needn't go through this module, but are here for completeness +def SetControlDataHandle(control, part, selector, data): + control.SetControlDataHandle(part, selector, data) + +def GetControlDataHandle(control, part, selector): + return control.GetControlDataHandle(part, selector) + +_accessdict = { + kControlPopupButtonMenuHandleTag: (SetControlDataHandle, GetControlDataHandle), +} + _codingdict = { kControlPushButtonDefaultTag : ("b", None, None), + kControlEditTextTextTag: (None, None, None), kControlEditTextPasswordTag: (None, None, None), + + kControlPopupButtonMenuIDTag: ("h", None, None), } def SetControlData(control, part, selector, data): + if _accessdict.has_key(selector): + setfunc, getfunc = _accessdict[selector] + setfunc(control, part, selector, data) + return if not _codingdict.has_key(selector): raise KeyError, ('Unknown control selector', selector) structfmt, coder, decoder = _codingdict[selector] @@ -20,6 +38,9 @@ def SetControlData(control, part, selector, data): control.SetControlData(part, selector, data) def GetControlData(control, part, selector): + if _accessdict.has_key(selector): + setfunc, getfunc = _accessdict[selector] + return getfunc(control, part, selector, data) if not _codingdict.has_key(selector): raise KeyError, ('Unknown control selector', selector) structfmt, coder, decoder = _codingdict[selector] |