In order for this to work for my patches (created using jbfill.m, a FileExchange script), I needed to modify line 95 because the axis handle was only one level up from the patch handle. Perhaps there should be a warning issued or some kind of additional handling if the handle two levels up is not an axis (in my case it was the figure handle).
Then this worked great! Thank you for a terrific m file!
With the original code, selectedIndex is set to 3 for pushes on either str1 or str2 (the default button, "cancel" is at index #3 and has it's "value" property set to true, which is then found in the function line: "choise=find( cell2mat( get(buttnHndl, 'Value') ) ); "). The modified code returns 1 for str1 and 2 for str2 (using the handle of the object that executed the callback, it does not have to find a true or false value).