How do I change the pointer property on a UI Figure?

50 vues (au cours des 30 derniers jours)
Samir Chowdhury
Samir Chowdhury le 12 Déc 2019
Modifié(e) : Adam Danz le 15 Août 2021
I have an appdesigner gui in Matlab 2018b that has a callback for a listbox that plots a set of data on a set of axes adjacent to it. The callback calls a function and I want to change the pointer properties such that upon the clicking of a new data set, it changes the mouse to watch.
I tried
set(gcf, 'Pointer', 'watch');
And that creates a new figure, which is not the functionality I want.
I tried:
set(myUIHandle, 'Pointer', 'watch');
That didn't work either saying UIFigures have no such property
I also tried iptPointerManager to no avail.
Is there no current solution for this in the current version of matlab? Are there no workarounds to this?

Réponse acceptée

Adam Danz
Adam Danz le 12 Déc 2019
Modifié(e) : Adam Danz le 25 Juin 2020
As of r2019b the Pointer functionality is not supported for UIFigures. However, you'll notice that there is a Pointer property for UIFigures and it does not throw an error when the pointer is set to 'arrow' which is the default and only accepted value.
app.UIFigure.Pointer = 'arrow';
This suggests that pointer options may be coming as App Designer features continue to be rolled out.
See this list for additional unsupported functionality in App Designer.
update: Now supported in r2020a
Pointer control is now supported in UIFigures and Apps as of r2020a.
See this community highlight to learn how to
  1. Change the default pointer for a uifigure or app
  2. Change the pointer dynamically when it meets certain conditions
  3. Create your own pointer symbol
  2 commentaires
Davi Carvalho
Davi Carvalho le 15 Août 2021
Hello, is it possible to do the opposite to what the OP asked and keep Matlab from changing the cursor automatically?
For example, every time the user gets closer to a point drawn with the drawpoint() function, the pointer changes to 'fleur', I'd like to keep it as 'arrow' at all times, can it be done?
Adam Danz
Adam Danz le 15 Août 2021
Modifié(e) : Adam Danz le 15 Août 2021

Yes it's possible. I show how to do that in this answer .

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Develop uifigure-Based Apps dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by