[squeak-dev] The Inbox: MorphicExtras-ct.282.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Inbox: MorphicExtras-ct.282.mcz

commits-2
A new version of MorphicExtras was added to project The Inbox:
<a href="http://source.squeak.org/inbox/MorphicExtras-ct.282.mcz">http://source.squeak.org/inbox/MorphicExtras-ct.282.mcz

==================== Summary ====================

Name: MorphicExtras-ct.282
Author: ct
Time: 18 September 2020, 3:15:00.754788 pm
UUID: 83d0d7e0-6e0e-4293-93ec-0f06402bc888
Ancestors: MorphicExtras-kfr.276

Adds Workspace examples for demonstration of Editor and Text.Reuploaded to fix bad dependency in #extraExample1 (it has to be #asTextFromHtml instead of #asHtmlText). Replaces MorphicExtras-ct.276, which can be moved to the treated inbox.

This commit is part of reconstruction of Objectland (also known as "The Worlds of Squeak"). For more information, see: http://forum.world.st/The-Inbox-MorphicExtras-ct-267-mcz-td5104764.html

=============== Diff against MorphicExtras-kfr.276 ===============

Item was added:
+ ----- Method: Workspace class>>extraExample1 (in category '*MorphicExtras-examples') -----
+ extraExample1
+ "ToolBuilder open: Workspace extraExample1"
+
+ | quoteAttributes |
+ quoteAttributes := {TextEmphasis bold. TextColor color: Color mocha}.
+ ^ Workspace new
+ contents: (Text streamContents: [:stream | ({
+ '<i>"When in doubt, try it out!!"</i>' asTextFromHtml
+ addAllAttributes: quoteAttributes;
+ yourself.
+ '-- Dan Ingalls' asText
+ addAllAttributes: quoteAttributes;
+ addAttribute: TextAlignment rightFlush;
+ yourself.
+ String empty. }
+ , ((self class sourceCodeAt: #extraExampleContents1) asString lines allButFirst: 3)
+ do: [:line | stream nextPutAll: line]
+ separatedBy: [stream cr])]);
+ shouldStyle: false;
+ yourself!

Item was added:
+ ----- Method: Workspace class>>extraExample2 (in category '*MorphicExtras-examples') -----
+ extraExample2
+ "ToolBuilder open: Workspace extraExample2"
+
+ ^ self new
+ contents: (((self class sourceCodeAt: #extraExampleContents2)
+ asString lines allButFirst: 3)
+ joinSeparatedBy: Character cr);
+ yourself!

Item was added:
+ ----- Method: Workspace class>>extraExampleContents1 (in category '*MorphicExtras-examples') -----
+ extraExampleContents1
+ "This is example code for #extraExample1"
+
+ "Run the following lines by pressing <cmd>d:"
+ Transcript showln: 'Hello world!!'.
+ self inform: 'This is a dialog box. Quite easy, isn''t it?'.
+
+ "Print the result of an expression using <cmd>p"
+ 6 * 7.
+ Float pi i exp stringForReadout.
+ (16 factorial + 1) isPrime.
+ (Smalltalk allClasses gather: #selectors) size.!

Item was added:
+ ----- Method: Workspace class>>extraExampleContents2 (in category '*MorphicExtras-examples') -----
+ extraExampleContents2
+ "This is example code for #extraExample2"
+
+ "Inspect any (sub)expression result by pressing <cmd>i"
+ (20 to: 40 by: 2) asOrderedCollection
+ addFirst: 16;
+ addLast: 42;
+ sort: [:x | x \\ 3] descending;
+ yourself.
+
+ "Explore any (sub)expression result by pressing <cmd>I"
+ Project current world.
+
+ "Debug any (sub)expression using <cmd>D"
+ (1 to: 9) join asNumber sqrt truncateTo: 1e-3.
+ (SystemWindow windowsIn: ActiveWorld)
+ select: [:window | window bounds isWide]
+ thenDo: [:window | window color: window color negated].!