Reputation: 1356
The following command create a horizontal slider in octave/matlab filling the current window:
h= uicontrol ('style', 'slider', 'units','normalized', 'position',[0,0,1,1])
With the function call get(h)
you can display all properties of the slider. Some more relevant properties are listed here:
type = uicontrol
style = slider
max = 1
min = 0
value = 0.50000
sliderstep =[0.010000 0.100000]
position =[0 0 1 1]
units = normalized
horizontalalignment = center
verticalalignment = middle
Is there any property to control the orientation of the slider? Or is there another way of creating a vertical slider?
Upvotes: 2
Views: 3496
Reputation: 1356
I found the solution myself: The slider orientation is defined implicitly from the aspect ratio of the uicontrol. If it is initially wider than high it becomes a horizontal slider, if it is higher than wide it becomes a vertical slider.
To control the aspect ratio set the 'position'
property of the uicontrol to [xpos ypos width height]
.
The following command creates a vertical slider:
uicontrol('style','slider','units','normalized','position',[0,0,0.2,1.0]);
Upvotes: 3