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

49 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Adam Danz
Adam Danz il 12 Dic 2019
Modificato: Adam Danz il 25 Giu 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 Commenti
Davi Carvalho
Davi Carvalho il 15 Ago 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 il 15 Ago 2021
Modificato: Adam Danz il 15 Ago 2021

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Develop uifigure-Based Apps in Help Center e File Exchange

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by