function pos = getpanelpos(this)
%GETPANELPOS   Get the panel position.

%   Author(s): J. Schickler
%   Copyright 1988-2022 The MathWorks, Inc.

% % Disable the listeners so that we don't fire the callback to the
% % ResizeEvent and force extra updates.
% l = get(this, 'Panel_Listeners');
% set(l, 'Enabled', 'Off');

hp = get(this, 'Panel');

oldResizeFcn = get(hp, 'ResizeFcn');
set(hp, 'ResizeFcn', '');

origUnits = get(hp, 'Units');    set(hp, 'Units', 'Pixels');
if ishghandle(hp, 'uipanel')
    pos = get(hp, 'InnerPosition'); set(hp, 'Units', origUnits);
else
    pos = get(hp, 'Position'); set(hp, 'Units', origUnits);
end


set(hp, 'ResizeFcn', oldResizeFcn);
% set(l, 'Enabled', 'On');

% [EOF]
