Tuesday, October 09, 2007

Week 9

Creative Computing : GUI(2)
Keywords for the Week:
* Color : Each component has a value from 0.0 to 1.0 except in new255 :
Color.new(red, green,blue, alpha), Color.rand(hue, sat, val, alpha)
* Document: Opens up a text document.Document(title, text, isPostWindow);
background_set the background color of a Document
(
a = Document("background", "'documentwindow");
a.background_(Color.blue(alpha:0.8));
)

* Font : command-T to look for Font names.
* SC2DSlider : 2 dimensional slider
* SC2DTabletSlider : a 2D slider with support for extended wacom data
* SCButton : each state: [ name, text color, background color ] . Failure to set any states at all results in an invisible button.
SCCompositeView : A view that contains other views.
SCEnvelopeView : opens the envelope window whose nodes can be moved.
SCHLayoutView : Puts the sliders etc horizontally in a formatted layout.
SCVLayoutView : Puts the sliders etc vertically in a formatted layout.
SCMultiSliderView : Multisliders in a single window.
SCNumberBox : Number Box
SCPopUpMenu : Pop up menu
SCRangeSlider : sliders within a specified range
SCTabletView : Tablet view. Can receive data ffrom wacom or mouse.
SCTextField : Text based entry
SCView : SCView is the abstract superclass for all SC GUI widgets.
SCWindow : User Interface window : SCWindow.new(name, bounds, resizable, border);
resize : resize behavior for SCView..
1 - fixed to left, fixed to top
2 - horizontally elastic, fixed to top
3 - fixed to right, fixed to top

4 - fixed to left, vertically elastic
5 - horizontally elastic, vertically elastic
6 - fixed to right, vertically elastic

7 - fixed to left, fixed to bottom
8 - horizontally elastic, fixed to bottom
9 - fixed to right, fixed to bottom
-------------------------------------------------------------------------
Quiz : The error was there should be "states" instead of "state"..
Right : but.states = [["suffering",Color.black,Color.red] and not
Wrong : but.state = [["suffering",Color.black,Color.red],
code
(
var win, but;

win = SCWindow(
name: "Panel"
);
win.front;

but = SCButton(
parent: win,
bounds: Rect(20, 20, 230, 50)
);
but.states = [["suffering",Color.black,Color.red],
["living",Color.black,Color.blue]];
but.action = {"hello".postln;}
)

References :
* Haines.Christian."Workshop-9-sem2 conducted on GUI(2) .Programming with SuperCollider".4 October'2007.Electronic Music Unit.University of Adelaide, South Australia.
* IXI softwares, www.ixi-software.net
* McCartney , James et al . 2007,SuperCollider Inbuilt Help.
* Source Forge, http://supercollider.sourceforge.net/

Film Sound:
Forum : Bent Leather Band

No comments: