Why are the number calls to the ResizeFcn different based on window edge selection in MATLAB 7.8 (R2009a)?

1 view (last 30 days)
When using the resizeFcn property with figures, there are two ways that Windows and MATLAB appear to be handling this event.
If I resize the window from the right or bottom (east or south), windows waits for a mouse up event before attempting to redraw.
When resizing from top or left (north or west) edge of the figure, it repeatedly resizes (calls ResizeFcn) the window upon mouse movement.
What I would like is for my resizeFcn to get called only once on the mouse up. Please execute the function given below and resize using different edges of the figure window.
%%%%%%%%%%%%%%%%
function resize_bug()
clc
global I
f=figure;
plot(1:10);
I=1;
set(f,'resizefcn',@myresizefigure);
function myresizefigure(src,evt)
% RESIZING OPERATIONS
global I
get(gcf, 'position');
fprintf('RezizeFcn call # : %d \n',I)
I=I+1;
%%%%%%%%%%%%%%%%

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 3 Feb 2011
This is due to be a setting at the operating system level that determines this behavior of the ResizeFcn. The ResizeFcn behaves as expected.
On WinXP, there is a setting under the Display Properties --> Appearance tab --> Effects. In the Effects dialog, there is a checkbox called "Show window contents while dragging". This behavior can be seen on a Windows XP system if the checkbox is checked. When the checkbox is UNchecked (and MATLAB is restarted) this behavior will change to the one expected.
The corresponding setting is on a Windows Vista system would be under the path:
Control Panel\Appearance and Personalization\Personalization
Else, if you Right click on the desktop ---> goto "Personalize" ---> "Window Color and Appearance" --> Effects button.
For Windows 7, please take the following steps:
1) Press [Windows Key]+R
2) Type "systempropertiesadvanced"
3) Click "OK"
4) Under "Performance", click "Settings"
5) Uncheck "Show window contents while dragging"
6) Click "OK"

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R2009a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!