MATLAB: Does the UITABLE Extent property return different values in MATLAB 7.7 (R2008b) than it did in MATLAB 7.6 (R2008a)

MATLAB

When I set the Position property height and width to the height and width values returned by the Extent property of a uitable, I observe different results in R2008a and R2008b. This seems to stem from the fact that the Extent property returns different values for the same uitable in R2008a and R2008b. For example, when I execute the following code,
figh = figure;
u = uitable('Parent',figh,'Data',ones(1,6),'Units','pixels');
drawnow;
pos = get(u, 'Position');
ext = get(u, 'Extent')
set(u, 'Position', [pos(1:2) ext(3:4)]);
figPos = get(figh, 'Position');
set(figh, 'Position', [figPos(1:2) ext(3:4)+25]);
in R2008a, I receive,
ext =
0 0 482 36
and in R2008b, I receive,
ext =
0 0 484 38
The uitable in R2008b has a few pixels of extra space on the right and bottom when using the Windows XP theme, as shown in the attached screenshot.

Best Answer

There is a bug in MATLAB 7.6 (R2008a) because of which a uitable is drawn with scroll bars even when its position height and width are set to the height and width reported by its Extent property under the Windows classic theme. This bug was fixed in R2008b, which is why the values of the extent property of the same uitable reported in R2008b are slightly larger. A bug report for this issue is available at the following link. Please note that you will need to log in to your MathWorks account view this report.
This bug fix can cause a uitable under the Windows XP theme to contain a few extra pixels of white space in R2008b. You can work around this by accounting for the difference as follows:
figh = figure;
u = uitable('Parent',figh,'Data',ones(1,6),'Units','pixels');
drawnow;
pos = get(u, 'Position');
ext = get(u, 'Extent')
set(u, 'Position', [pos(1:2) ext(3:4)-2]);