- Close your eyes during resizing. It's time to calm down and take a break from visual impressions.
- Disable the resizing controlled by Matlab, but create a dedicated WindowButtonDownFcn by your own. If the mouse clicks near to the border (or in dedicated objects in the corners), the cursor changes to the appropriate shape and the WindowButtonMotionFcn can control the position of the figure.
Matlab ResizeFcn callback
조회 수: 25(최근 30일)
I am worried about the look and feel of my GUI designed with Matlab. In concrete, I do not like how the figure window resizing is achieved. I have an uitabgroup (tabpanel) inside which there are three panels with border etchedin. Each time the figure is resized, it appears flickering between both positions of the panels. I hate this optical effect. So, I decided to build my own resizefcn callback to get being pleased. However, I realize Matlab first resizes the figure window and then it runs the commands inside the resizefcn callback. I would like to know if there is some solution that lets me to change this behaviour.
Jan 2012년 2월 27일
Sometimes the resizing looks weird: I have a uitree object on the left side of a GUI. During the resizing movement (mouse hold down, ResizeFcn is not called), the display is as expected, when I have selected the right lower corner of the figure. Then the lower left corner of the uitree keeps its absolute position in the figure, while the size is not changed - not nice, but not confusing.
But when I select the lower or left border of the figure, the uitree behaves funny, e.g. the height is reduced by the double rate than the reduction of the heigth of the figure. The optical impression is as strange as the textual description...
Of course everything is fine, when the ResizeFcn is called after lifting the mouse button. But the "look&feel" during the resizing is awkward.
Walter Roberson 2012년 2월 27일
You might be able to reduce the flash grunge by setting the figure visibility to 'off' during the resize process, and then to 'on' again when the resize is finished.
Malcolm Lidierth 2012년 2월 27일
If you a using the mouse to resize, the figure will always be updated multiple times because it has multiple sizes between the start and end of the mouse drag. There are any number of solutions. See http://undocumentedmatlab.com/blog/controlling-callback-re-entrancy/