Third in a series of gradually more complex and varied GUI examples.
A more complex example

( // Load two synthdefs
SynthDef("variablesine", { arg freq=80, freq2=1, amp=1;
	var osc;
	osc = SinOsc.ar(freq*freq2);
	Out.ar(0, osc*amp);
}).writeDefFile;

SynthDef("modulator", { arg freq=80, amp=1;
	var osc;
	osc = SinOsc.ar(freq);
	ReplaceOut.kr(10, osc*amp);
}).writeDefFile;
)

( // Load the interface...
// the variables...
var w, b1, b2, b3, b4, sl1, sl2, sl3, sl4, s;

s = Server.local;
w = SCWindow("Simple FM Controller", Rect(100, 800, 400, 450));
w.front; // send the window to the front...

// First button
b1 = SCButton(w, Rect(5, 0, 150, 24));
b1.states = [
		["Start Server", Color.black, Color.green],
		["Stop Server", Color.white, Color.red],
			];
b1.action = { arg view;
		if (b1.value == 1, {
				s.boot;
		},{
				s.quit;
		});
};

// Second button
b2 = SCButton(w, Rect(5, 30, 150, 24));
b2.states = [
		["Load Sine", Color.black, Color.green]
			];
b2.action = { arg view;
	s.sendSynthDef("variablesine");
};

// Third button
b3 = SCButton(w, Rect(155, 30, 150, 24));
b3.states = [
		["Load Modulator", Color.black, Color.green]
			];
b3.action = { arg view;
	s.sendSynthDef("modulator");
};

// Fourth button
b4 = SCButton(w, Rect(5, 60, 150, 24));
b4.states = [
		["Play", Color.black, Color.green],
		["Stop", Color.white, Color.red],
			];
b4.action = { arg view;
		if (b4.value == 1, {
				s.sendMsg("/s_new", "variablesine", 1000, 1, 0, "freq", 80, "freq2", 1);
				s.sendMsg("/s_new", "modulator", 1001, 0, 0, "freq", 80);
				s.sendMsg("n_map", 1000, \freq2, 10);
		},{
				s.sendMsg("/n_free", 1000);
				s.sendMsg("/n_free", 1001);
		});
};

// Four sliders...
sl1 = SCSlider(w, Rect(5, 100, 25, 300));
sl1.action = {
		var val;
		val = ((800*sl1.value)+80);
		val.postln;
		s.sendMsg("/n_set", 1000, "freq", val);
};

sl2 = SCSlider(w, Rect(35, 100, 25, 300));
sl2.action = {
		var val;
		val = sl2.value;
		val.postln;
		s.sendMsg("/n_set", 1000, "amp", val);
};

sl3 = SCSlider(w, Rect(65, 100, 25, 300));
sl3.action = {
		var val;
		val = ((1000*sl3.value)+1);
		val.postln;
		s.sendMsg("/n_set", 1001, "freq", val);
};

sl4 = SCSlider(w, Rect(95, 100, 25, 300));
sl4.action = {
		var val;
		val = (20*sl4.value);
		val.postln;
		s.sendMsg("/n_set", 1001, "amp", val);
};

)