Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / MATLAB / October 2008



Tip: Looking for answers? Try searching our database.

Another strange GUI question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wapo - 01 Oct 2008 07:39 GMT
Hi all,

This is another question on my series of questions regarding GUIS. I
hope mathworks is reading.

Situation: A GUI coupled with a heavy script. The script is running in
the background and the GUI is waiting for the script to finish. If we
overlap the MATLAB GUI with another window (lets say the browser) and
then return back to the GUI then the GUI is messed up. Segments of it
are not visible any more or there is white background color, etc.

Why is that? I am guessing that MATLAB is doing the rendering of the
window and since its stuck with the script it cannot update the GUI
(although it shouldn't have been messed-up in the first place).

Any help anybody? Mathworks?

Thanks in advance

Apo
Bruno Luong - 01 Oct 2008 08:01 GMT
> Hi all,
>
[quoted text clipped - 12 lines]
>
> Any help anybody? Mathworks?

You should insert statements in the script to call now and then REFRESH or DRAWNOW so as matlab flushes the queue graphic events. Otherwise, yes, the script could take the high priority of CPU and figure is not updated as often as you like.

I don't know what alternative you have if the CPU is stuck in a single long built-in function. Probably running a parallel timer that call periodically drawnow.

The graphic display is usually no "messed-up" (even if you think so) just delayed.

And let me guess your OS: probably Windows?

Bruno
wapo - 01 Oct 2008 08:22 GMT
Hi Bruno,

Thanks for your answer but I still dont get it for the following
reason. The script is not supposed to update the GUI. The GUI is just
sitting there waiting. So, in theory the GUI doesnt need re-rendering.
It's MATLAB that gets messed-up.

Yes, the OS is windows. Does that mean that it's the OS's
responsibility the mess? Because I dont see similar issues with other
programs. So, I am guessing (once again) that MATLAB keeps the control
of the figure and when stuck with something heavy does have the time
to refresh the different buffers in the graphic card (and in that case
your answer makes sense; so in theory if it's MATLAB fault the
refreshing should work).

I will this anyway and see what happens.

Apo
Bruno Luong - 01 Oct 2008 08:54 GMT
> Hi Bruno,
>
> Thanks for your answer but I still dont get it for the following
> reason. The script is not supposed to update the GUI. The GUI is just
> sitting there waiting. So, in theory the GUI doesnt need re-rendering.
> It's MATLAB that gets messed-up.

No. Graphic objects are created as small rectangle "standalized" across softwares and handled by OS (all graphic objects of Windows are rectangular shape, that why the OS is called WINDOWS). OS are responsible to issues "Events", and software (MATLAB) are (could be) responsible for refreshing the button when an event is received from OS. Software does not when their buttons are hidden by a Browser. And when the Browser moves out "someone" must refresh the button. Who is "someone"? It could be OS or Matlab, depending on the Event Callback is captured or not.

In principle, how and how often the Events are proceeded is managed by a default scheme that works all right for most of the cases. However your script, even if it does not work directly with GUI, can disturb the timings of the graphical refreshing, and you should be aware about it, and take an appropriate action when you are putting your code together with GUI. This phenomenon is problematic for Windows based software, which is historically is a mono-thread OS.

Bruno
Jan Simon - 06 Oct 2008 14:32 GMT
Dear wapo!

Did you enable the BackingStore property of the figure?
If the renderer is OpenGL, problems with missing updates can depend on the graphic card's driver also.

Jan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.