How can I turn the property inspector off?

24 ビュー (過去 30 日間)
Paul Mennen
Paul Mennen 2023 年 1 月 5 日
コメント済み: Steven Lord 2023 年 1 月 5 日
Type the following:
h = uicontrol('callback','disp(pi)');
[SL: fixed typo in callback; the closing ) had been omitted.]
Note that when you click on the button created "3.1416" is displayed as expected. Now type:
inspect(h);
With older versions of Matlab, I could inspect the properties I was interested in, close the inspect window and continue using my program. (In this case it will continue to display pi when I click on the button). However I tried this recently on a system with a newer version of Matlab (R2021b) and after closing the property inspector, the button would not execute the callback. (It was trying to move the button instead). I tried typeing "inspect -close" but this seemed to have no effect.
Evidently once the property inspector sinks its teeth into a program it won't let go. The only way I could proceed is to close the program and restart it, which can be quite inconvenient at times. This seems to make the property inspector much less useful.
Is there a way to restore functionality to the control callbacks after using the property inspector?

採用された回答

Steven Lord
Steven Lord 2023 年 1 月 5 日
When you open Property Inspector it enables plot editing mode. [Note that the arrow icon in the toolbar has been selected after you call inspect.] With plot editing mode on, clicking on objects like a uicontrol selects it and allows you to manipulate (move, in particular) the object.
After you're done inspecting properties turn plot editing off with plotedit.
plotedit off
  2 件のコメント
Paul Mennen
Paul Mennen 2023 年 1 月 5 日
移動済み: Steven Lord 2023 年 1 月 5 日
Hi Steven. Thanks that command does the trick! My only other comment is that the documentation for the inspect function should be updated to include the fact that it executes "plotedit on". With that information I could have typed "help plotedit" and discovered the solution on my own. As it is, how could I have known? At any rate, thanks for your answer (which I will accept).
~Paul
Steven Lord
Steven Lord 2023 年 1 月 5 日
The easiest way to ensure that this feedback gets to the documentation staff responsible for that page is to give the page a star rating (the prompt "How useful was this information?" appears at the end of every or almost every documentation page) and then provide text feedback (the prompt changes to "Why did you choose this rating?" with a text box.)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParallel for-Loops (parfor) についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by