spinedit is an easy way to implement an edit with a slider attached to it to allow easy adjustment of numerical values in GUIs.
This package groups the two uicontrol components together and takes care of their callbacks, resulting in a kind of new uicontrol type named spinedit.
The zip file contains
- spinedit.m (the creation routine including the callback)
- spineditSetValue.m (a routine to set the value property to both components.)
Example of usage:
% define the spinedit
h = spinedit('position', [0.5 0.5 0.3 0.1], 'backgroundcolor', 'w', 'precision', '%6.4f');
% set an initial value
spineditSetValue(h, 0.5)
% somewhere later: get the value
val = get(h, 'value')
Requirements:
· MATLAB Release: R2006a