How to draw the horizontal and vertical scroll bar

I have seen some guys using the SDL to darw the scroll bar, but how? Can anyone give me some code to learn how to function the bar?