MATLAB: do callback on variable change?

I am trying to create a multi-tabbed GUI using uitabpanel(), found at http://www.mathworks.com/matlabcentral/fileexchange/11546 . I would like to resize the graphical user interface based on the open tab; it is available using uitabpanel.SelectedItem.

Basically, I would like to create a callback for monitoring uitabpanel.SelectedItem- when changing this variable, the GUI window should resize accordingly. Generally speaking, I'm looking for a way to control a variable and perform a callback when the variable changes the value.

Is it possible? How can i do this?

Thank!

+3
source share
2

MATLAB , - , - addlistener .

addlistener(hTab,'SelectedItem','PostSet',@(s,e)disp('SelectedItem changed'))
+4

uitab . , uitab, selectionChangeCallback selectionChangeFcn ( Matlab). , , .

, ( - ) - TIMER OBJECT, .

EDIT FEX uitab uipanel, , , ButtonDownFcn. , , uitab, .

+3

All Articles