iptremovecallback
Delete function handle from callback list
Description
Examples
Add and Remove Callbacks from Figure
Add three callbacks to a figure and try them interactively. Whenever
MATLAB® detects mouse motion over the figure, functions
f1
, f2
, and f3
are called in that order.
h = figure; f1 = @(varargin) disp("Callback 1"); f2 = @(varargin) disp("Callback 2"); f3 = @(varargin) disp("Callback 3"); id1 = iptaddcallback(h,'WindowButtonMotionFcn',f1); id2 = iptaddcallback(h,'WindowButtonMotionFcn',f2); id3 = iptaddcallback(h,'WindowButtonMotionFcn',f3);
Remove the callback f2
. Move the mouse over the figure
again. Whenever MATLAB detects mouse motion over the figure, only functions
f1
and f3
are called.
iptremovecallback(h,'WindowButtonMotionFcn',id2);
Input Arguments
obj
— Graphics object
figure | axes | uipanel | image
Graphics object, specified as a handle to a figure, axes, uipanel, or image graphics objects.
callback
— Callback property
character vector
Callback property of the graphics object obj
,
specified as a character vector. For a list of callbacks for graphics
objects, see Figure Properties, Axes Properties, Panel Properties, and Image Properties.
Data Types: char
ID
— Callback identifier
positive integer
Callback identifier for function fun
, specified as a
positive integer. This identifier is returned by iptaddcallback
when you add
a function to the callback list.
Version History
Introduced before R2006a
See Also
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)