Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Interaction of graphics object properties EraseMode and Visibility
Date: Wed, 3 Dec 2008 19:18:04 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 39
Message-ID: <gh6m1c$g3j$1@fred.mathworks.com>
References: <gh4rce$rvp$1@fred.mathworks.com> <gh5ec0$pq6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228331884 16499 172.30.248.37 (3 Dec 2008 19:18:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 3 Dec 2008 19:18:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:504786


A fix I have found is to explicity set the Visible property on all children of the uipanel to 'off' when the uipanel's Visible property is set to 'off'.

This seems like a bug, similar to what is reported here: http://www.mathworks.com/support/bugreports/details.html?rp=308433

When the Visible property of the uipanel is set to off, then graphics object children of the uipanel are not visible, provided their CData is not being changed, but their Visible property is still 'on' when queried.  This behavious also seems odd to me.  For example, referring again to the object heirarchy:

figure
    uipanel1
        axes
            image
    uipanel2
        uicontrol

>> get(h.uipanel1, 'visible')
ans =
off
>> get(h.uipanel2, 'visible')
ans =
on
>> get(h.axes, 'visible')
ans =
on
>> get(h.image, 'visible')
ans = 
    'on'
    'on'
    'on'
    ....
    'on'


Fortunately, their is a single line fix:

    set(h.uipanel1, 'Visible', 'off');
    set(h.uipanel2, 'Visible', 'on');
    set(findall(h.uipanel1), 'Visible', 'off');  %this is a workaround for a bug