function theResult = subsasgn(self, theStruct, theValue)

% subsasgn -- Set a field value.
%  subsref(self, theStruct, theValue) assigns theValue to a
%   field of self for the syntax "self.theField = theValue".
%   Use the case-sensitive spelling 'UserData' for that field.
%   Self is a "px" object.

% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.
%  All Rights Reserved.
%   Disclosure without explicit written consent from the
%    copyright owner does not constitute publication.
 
% Version of 05-Apr-1997 09:57:00.

if nargin < 1, help(mfilename), return, end

theSyntax = theStruct(1).type;
theField = theStruct(1).subs;

switch theSyntax
case '.'
   pxset(self, theField, theValue);
   theValue = self;
case '()'
   if strcmp(theField, ':')
      set(px(self), 'UserData', theValue);
      theValue = self;
   end
otherwise
   warning([' ## The "' theSyntax '" syntax is' ...
           ' not available to "px" objects.'])
   help(mfilename)
end

if nargout > 0
   theResult = theValue;
else
   disp(theValue)
end
