Skip to content

Commit

Permalink
scdoc: minor changes and new initAction example in Document
Browse files Browse the repository at this point in the history
  • Loading branch information
redFrik authored and timblechmann committed Feb 18, 2012
1 parent 029b0f6 commit 24abb73
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HelpSource/Classes/CocoaDocument.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ private::initClass, prSetDefaultFont, prSetSyntaxColorTheme, prDefaultUsesAutoIn

InstanceMethods::

private::prUsesAutoInOutdent_, prIsEditable_, prSetTitle, prGetTitle, prGetFileName, prSetFileName, prGetBounds, prSetBounds, prBalanceParens, prclose, prinsertText, prinitByIndex, prGetLastIndex, propen, prinitByString, prSetBackgroundColor, prGetBackgroundColor, prSetSelectedBackgroundColor, prGetSelectedBackgroundColor, prSelectLine
private::prUsesAutoInOutdent_, prIsEditable_, prSetTitle, prGetTitle, prGetFileName, prSetFileName, prGetBounds, prSetBounds, prBalanceParens, prclose, prinsertText, prinitByIndex, prGetLastIndex, propen, prinitByString, prSetBackgroundColor, prGetBackgroundColor, prSetSelectedBackgroundColor, prGetSelectedBackgroundColor, prSelectLine, prSetFont
14 changes: 14 additions & 0 deletions HelpSource/Classes/Document.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -822,3 +822,17 @@ fork({
}, AppClock)
)
::

Changing the default look of documents can be done with the help of the link::#*initAction:: method. Run the following example once. Afterwards all newly created documents will have a dark grey background. To make this change happen every time you start supercollider, put the code inside your startup.scd file (and optionally wrap it in a code::{}.defer(0.1):: ).
code::
(
Document.listener.background = Color.red; //a special color for post document
Document.listener.bounds = Rect(1, 461, 620, 567); //move and resize post document
Document.initAction = {|doc| //function to run for every new document
doc.background = Color.grey(0.1, 0.9);
doc.bounds = Rect(0, 119, 1280, 659);
doc.selectedBackground = Color(0.4, 0.05, 0.18);
doc.stringColor = Color.grey(0.9);
};
)
::
2 changes: 1 addition & 1 deletion HelpSource/Classes/Sweep.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ a.set(\run, 1)
a.set(\t_trig, 1)
a.free

//shorter duration and downwards
//shorter duration and downwards...
a= Synth(\lineReset, [\start, 1000, \end, 500, \dur, 0.5])
a.set(\t_trig, 1)
a.set(\run, 0)
Expand Down

0 comments on commit 24abb73

Please sign in to comment.