I try to make the uipanel change boarder colors while pressing and releasing mouse button on elsewhere except inputs and panel buttons.
function [oldpropvalu
Your problem is that you're defining your window callbacks as character vectors, which are evaluated in the base workspace where the variable varargin
doesn't exist. You can define them as anonymous functions instead:
set(varargin{1}, 'WindowButtonDownFcn', ...
@(~, ~) set(varargin{2}, 'BorderType', 'line', 'BorderWidth', 2, ...
'HighlightColor', [0 0 0]));
set(varargin{1}, 'WindowButtonUpFcn', ...
@(~, ~) set(varargin{2}, 'BorderType', 'beveledout', 'BorderWidth', 1, ...
'HighlightColor', [1 1 1]));