diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-19 22:20:55 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-19 22:20:55 (GMT) |
commit | 63f6b4984b9cd0e90402a375f3298cd94ed8bb55 (patch) | |
tree | 2ade02b92ed11e2b7b433c955c687fef999f1313 /Mac/Lib/lib-toolbox/ControlAccessor.py | |
parent | ab98ae9b4e004edbd8cff5893f0d580658682a6c (diff) | |
download | cpython-63f6b4984b9cd0e90402a375f3298cd94ed8bb55.zip cpython-63f6b4984b9cd0e90402a375f3298cd94ed8bb55.tar.gz cpython-63f6b4984b9cd0e90402a375f3298cd94ed8bb55.tar.bz2 |
Moved to either :Mac:Lib (WASTEconst and files that weren't generated) or to the Carbon package.
Diffstat (limited to 'Mac/Lib/lib-toolbox/ControlAccessor.py')
-rw-r--r-- | Mac/Lib/lib-toolbox/ControlAccessor.py | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Mac/Lib/lib-toolbox/ControlAccessor.py b/Mac/Lib/lib-toolbox/ControlAccessor.py deleted file mode 100644 index 20cf414..0000000 --- a/Mac/Lib/lib-toolbox/ControlAccessor.py +++ /dev/null @@ -1,57 +0,0 @@ -# Accessor functions for control properties - -from Controls import * -import struct - -# These needn't go through this module, but are here for completeness -def SetControlData_Handle(control, part, selector, data): - control.SetControlData_Handle(part, selector, data) - -def GetControlData_Handle(control, part, selector): - return control.GetControlData_Handle(part, selector) - -_accessdict = { - kControlPopupButtonMenuHandleTag: (SetControlData_Handle, GetControlData_Handle), -} - -_codingdict = { - kControlPushButtonDefaultTag : ("b", None, None), - - kControlEditTextTextTag: (None, None, None), - kControlEditTextPasswordTag: (None, None, None), - - kControlPopupButtonMenuIDTag: ("h", None, None), - - kControlListBoxDoubleClickTag: ("b", 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] - if coder: - data = coder(data) - if structfmt: - data = struct.pack(structfmt, 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] - data = control.GetControlData(part, selector) - if structfmt: - data = struct.unpack(structfmt, data) - if decoder: - data = decoder(data) - if type(data) == type(()) and len(data) == 1: - data = data[0] - return data - |