h = uiswitch()
h = uiswitch(parent)
h = uiswitch(..., propertyName, propertyValue)
| Paramètre | Description |
|---|---|
| parent | parent container. |
| propertyName, propertyValue | name-value pairs. |
| Paramètre | Description |
|---|---|
| h | UI component object. |
sw = uiswitch(parent, style) crée un interrupteur à deux états : styles 'slider' (défaut), 'rocker', 'toggle'. Items contient les deux libellés ; Value/ValueIndex/ItemsData suivent les règles habituelles ; ValueChangedFcn signale les changements.
f = uifigure('Visible', 'off', 'Name', 'Switches', 'Position', [100 100 520 300]);
sw = uiswitch(f, 'Position', [120 135 90 32]);
sw.Value = 'On';
rsw = uiswitch(f, 'rocker');
rsw.Position = [300 90 48 100];
rsw.Value = 'On';
drawnow();
f = uifigure();
sw = uiswitch(f, 'Items', {'Stop', 'Go'});
sw.Value = 'Go';
| Version | Description |
|---|---|
| 2.0.0 | initial version |