MATLAB GUI mouse shape control

38 ビュー (過去 30 日間)
Guanfeng Gao
Guanfeng Gao 2015 年 7 月 21 日
編集済み: Adam Danz 2021 年 8 月 14 日
I want to design a gui. And when the cursor point to different part of the GUI, I want it to change the shape itself. Such as becoming a cross or a hand when the cursor point to the image.
  1 件のコメント
Adam Danz
Adam Danz 2020 年 6 月 25 日
編集済み: Adam Danz 2021 年 8 月 14 日
along with
can be used to automatically change the pointer symbol when it hovers over certain objects within the GUI. In regular figures, the pointer manager is supported with figure | axes | uipanel | image objects. As of r2020a, the pointer manager can also be used with uifigures but it seems that only uifigure and uiaxes are supported plus any object plotted within the axes (see demo).

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

回答 (1 件)

Image Analyst
Image Analyst 2015 年 7 月 21 日
Like this?
% Change mouse pointer (cursor) to an arrow.
set(gcf,'Pointer','arrow')
drawnow; % Cursor won't change right away unless you do this.
% Change mouse pointer (cursor) to an hourglass.
% QUIRK: use 'watch' and you'll actually get an hourglass not a watch.
set(gcf,'Pointer','watch');
drawnow; % Cursor won't change right away unless you do this.
  4 件のコメント
Guanfeng Gao
Guanfeng Gao 2015 年 7 月 21 日
Thanks. I have already solved the problem.
Noam Greenboim
Noam Greenboim 2021 年 8 月 14 日
To get all available cursors, type:
set(gcf,'Pointer')
each one of the resulted list can be used as the 3rd input to the set function.

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

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by