Why does my uipanel disappear with normalized font units?

1 view (last 30 days)
Hello everybody,
I am working on a GUI and after implementing all functionalities I wanted to polish its appearance a bit. With one uipanel I encountered a behaviour I didnt expect. Consider the following code snippet (it is a minimal example reproducing the problem I am talking about)
f = figure;
fp = uipanel('Title','Main','Position',[0.5 0.1 0.4 0.8],'FontUnits','normalized');
The figure window is being opened, but I cannot see the panel. The odd thing is that this happens
  1. Only, if i set 'FontUnits','normalized'
  2. Only for some certain positions of the panel
For example both
fp = uipanel('Title','Main','Position',[0.5 0.1 0.4 0.8]);
and
fp = uipanel('Title','Main','Position',[0.4 0.1 0.4 0.8],'FontUnits','normalized');
work completely fine. One more observation: For some positions Matlab displays the error
Caught unexpected exception of unknown type.
Caught unexpected exception of unknown type.
And yes, it shows it twice. However, I was unable to figure out under which conditions it shows the error.
I am running Matlab 2016a on a Windows 10 64bit machine. If I missed any important information, please let me know.
I'll be glad, if anyone has an idea how to solve this problem and shares it here.
  3 Comments
Benjamin
Benjamin on 31 Jul 2018
Edited: Benjamin on 31 Jul 2018
Ok, thanks. This solves the issue indeed. I still think this is some unintended behaviour of MatLab, but at least i know what to do now. Thanks!
Edit: I would like to mark the question as answered. I really cannot find the button for it. If anybody enlightened me, I gladly do it.
Adam
Adam on 31 Jul 2018
You can only accept answers if an actual answer is given and having an accepted answer is an indication that the question has been satisfactorily answered.

Sign in to comment.

Answers (0)

Categories

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

Products


Release

R2016a

Community Treasure Hunt

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

Start Hunting!