Problem with right mouse click

How can I get a horizontal slider to remain on the screen after I've let go of the right mouse button. When I use GetMouseButton the button must be held down to show the slider.

var somenum = 10;
function OnGUI () {
if (Input.GetMouseButton(1)) 
somenum = GUI.HorizontalSlider(Rect(10,10,40,200),somenum,20,0);
print(somenum);
}

I there another way to have the slider persist on the screen after you let go of the RMB?

I plan to build in OK and Cancel buttons for control of the slider.

Store state information.

var somenum = 10;
var rightClicked;

function OnGUI () {
    if (rightClicked) {
        somenum = GUI.HorizontalSlider(Rect(10,10,40,200), somenum,20,0);
        print(somenum);
    }
    else if (Input.GetMouseButton(1)) rightClicked = true;
}