Doesn't ButtonDownFcn work for left-click?

1 view (last 30 days)
hi everyone, i would to know if it's possible to have the same behavior for the ButtonDownFcn for the left-click instead of right-click. i have to set invisible an editText when i click on another editText. Now it works only with right click. i've simply used this line code:
set(handles.editGIRI_r,'Visible','Off');
  1 Comment
Walter Roberson
Walter Roberson on 21 Sep 2015
Do you have zoom or pan turned on? Those interfere with clicking.

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 21 Sep 2015
Look at the documentation for a uicontrol's ButtonDownFcn, Callback, and Enable properties. The ButtonDownFcn for a uicontrol will execute on left-click if the uicontrol is not enabled (off or inactive.) If the uicontrol is enabled, its Callback executes instead.
  1 Comment
Daniele Morello
Daniele Morello on 22 Sep 2015
Edited: Daniele Morello on 22 Sep 2015
thank's a lot :) it works. but now, i have to click two times to insert a value? the first time to enable the edit text and the second time to allow to type a value. can i resolve in one step?

Sign in to comment.

More Answers (0)

Categories

Find more on Entering Commands in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!