image processing - How to disable a button on the uigetpref dialogue in MATLAB? -
i developing tool image processing on matlab using guide. have small snag correct in it. question is:
*
the user asked select 1 of 2 images on tool (in different axis) , handle of image passed on using function further processing. using function uigetpref purpose. want disable 1 button on dialogue when condition true. how can that? documentation not list such option.
the instruction:
selectedbutton = uigetpref(... 'mygraphics',... % group 'imageselection',... % preference 'select image',... % window title {'please select picture enable labelling on.' '' 'the labelled points shown in other 2 axes after completion'},... {1,2;'image a','image b'},... % values , button strings 'extraoptions','cancel',... % additional button 'defaultbutton','image a',... % default choice 'helpstring','help',... % string button 'helpfcn','doc(''axes'');');
thank you.
if want button grayed out or disabled, you're going need either construct own dialog instead of using uigetpref, or you're going need somehow find hidden handle uigetpref dialog, , manually gray out button.
if have button display or not display depending on condition, try code:
mycondition = true; % mycondition = false % uncomment test switch mycondition case true buttondetails = {1,2;'image a','image b'}; defaultbutton = 'image b'; case false buttondetails = {1;'image a'}; defaultbutton = 'image a'; end selectedbutton = uigetpref(... 'mygraphics',... 'imageselection',... 'select image',... {'please select picture enable labelling on.' '' 'the labelled points shown in other 2 axes after completion'},... buttondetails,... 'extraoptions','cancel',... 'defaultbutton',defaultbutton,... 'helpstring','help',... 'helpfcn','doc(''axes'');');
Comments
Post a Comment