Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on Squeak (not on other SmallTalks)
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/squeak.e>
#           or at <http://angg.twu.net/e/squeak.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




(global-set-key   (kbd "C-v") 'yank)
(global-unset-key (kbd "C-v"))

# «.mailing-lists»		(to "mailing-lists")
# «.irc»			(to "irc")
# «.tutorials»			(to "tutorials")
# «.squeak-by-example»		(to "squeak-by-example")
# «.squeak-shout»		(to "squeak-shout")
# «.openInWorld»		(to "openInWorld")
# «.addAlarm:»			(to "addAlarm:")
# «.SimpleSwitchMorph»		(to "SimpleSwitchMorph")
# «.SimpleButtonMorph»		(to "SimpleButtonMorph")
# «.Matrix»			(to "Matrix")
# «.quinto»			(to "quinto")
# «.books»			(to "books")
# «.Point3D»			(to "Point3D")
# «.OSProcess»			(to "OSProcess")
# «.See»			(to "See")
# «.See.st.html»		(to "See.st.html")
# «.CompiledMethod»		(to "CompiledMethod")
# «.fileOut-format»		(to "fileOut-format")
# «.menuitem-action»		(to "menuitem-action")
# «.openSelectorBrowser»	(to "openSelectorBrowser")
# «.ToolBuilder»		(to "ToolBuilder")
# «.squeaksource»		(to "squeaksource")
# «.changes-and-screenshots»	(to "changes-and-screenshots")
# «.commandKeyHelp»		(to "commandKeyHelp")
# «.CommandShell»		(to "CommandShell")
# «.squeak-3.6»			(to "squeak-3.6")
# «.learn-squeak»		(to "learn-squeak")
# «.squeak-sarge»		(to "squeak-sarge")
# «.squeak-vm»			(to "squeak-vm")
# «.squeak-debian-2006»		(to "squeak-debian-2006")
# «.squeak-on-etch»		(to "squeak-on-etch")
# «.squeak-binfmts»		(to "squeak-binfmts")
# «.install-2023»		(to "install-2023")
# «.install-2022»		(to "install-2022")
# «.smalltalkeditor-feb2022»	(to "smalltalkeditor-feb2022")
# «.tweaks.cs»			(to "tweaks.cs")
# «.autocompletion»		(to "autocompletion")
# «.Tools-menu»			(to "Tools-menu")
# «.Workspace»			(to "Workspace")
# «.openWorkspace»		(to "openWorkspace")
# «.workspaces-compiler»	(to "workspaces-compiler")
# «.HelpBrowserB»		(to "HelpBrowserB")
# «.morphic-events»		(to "morphic-events")
# «.IconicButton»		(to "IconicButton")
# «.EdrxMorph»			(to "EdrxMorph")
# «.KeyboardExerciser»		(to "KeyboardExerciser")
# «.Bricks»			(to "Bricks")
# «.Kedama»			(to "Kedama")
# «.game-prog-with-etoys»	(to "game-prog-with-etoys")
# «.PolygonMorph»		(to "PolygonMorph")
# «.PolygonMorph-EventHandler»	(to "PolygonMorph-EventHandler")
# «.PolygonMorph-EventHandler-2»	(to "PolygonMorph-EventHandler-2")
# «.PolygonMorph-EventHandler-3»	(to "PolygonMorph-EventHandler-3")
# «.synthetic-kb-event»		(to "synthetic-kb-event")
# «.EToys-kfr»			(to "EToys-kfr")
# «.activeGlobals»		(to "activeGlobals")
# «.currentWorld»		(to "currentWorld")
# «.morphic-tutorial-1»		(to "morphic-tutorial-1")
# «.debugger»			(to "debugger")
# «.generateKeyboardEvent»	(to "generateKeyboardEvent")
# «.handlesKeyboard»		(to "handlesKeyboard")
# «.respondsTo»			(to "respondsTo")
# «.globals»			(to "globals")
# «.world-morphs»		(to "world-morphs")
# «.question-about-a»		(to "question-about-a")
# «.ATheWorldMainDockingBar»	(to "ATheWorldMainDockingBar")
# «.20220302-transpose»		(to "20220302-transpose")
# «.etoys-qg»			(to "etoys-qg")
# «.etoys»			(to "etoys")
# «.etoys-blob-car»		(to "etoys-blob-car")
# «.EventRecorder»		(to "EventRecorder")
# «.LineMorph»			(to "LineMorph")
# «.HorizontalNumberLineMorph»	(to "HorizontalNumberLineMorph")
# «.Slider»			(to "Slider")
# «.See-store»			(to "See-store")
# «.search-bar»			(to "search-bar")
# «.resetHandlerFields»		(to "resetHandlerFields")
# «.Delay»			(to "Delay")
# «.TerseGuideHelp»		(to "TerseGuideHelp")
# «.See-terseGuide»		(to "See-terseGuide")
# «.BubbleFilters»		(to "BubbleFilters")
# «.save-keystroke-events»	(to "save-keystroke-events")
# «.non-openInWorld-able»	(to "non-openInWorld-able")
#   «.TestLayoutMorph»		(to "TestLayoutMorph")
#   «.LayoutPolicy»		(to "LayoutPolicy")
# «.EncoderForV3»		(to "EncoderForV3")
# «.TheWorldMenu-newMorph»	(to "TheWorldMenu-newMorph")
# «.browseFullProtocol»		(to "browseFullProtocol")
# «.Interval»			(to "Interval")
# «.Context»			(to "Context")
# «.roguerrants»		(to "roguerrants")
# «.DisplayScreen»		(to "DisplayScreen")
# «.LambdaMessageSend»		(to "LambdaMessageSend")
# «.launchPartVia»		(to "launchPartVia")
# «.Mines»			(to "Mines")
# «.EventRecorder»		(to "EventRecorder")
# «.PasteUpMorph»		(to "PasteUpMorph")

# (find-es "smalltalk")



http://minnow.cc.gatech.edu/squeak/uploads/SqueakLanguageRef.3.html
http://minnow.cc.gatech.edu/squeak/uploads/SqueakClassesRef.html




#####
#
# mailing-lists
# 2023jan26
#
#####

# «mailing-lists»  (to ".mailing-lists")
# https://wiki.squeak.org/squeak/608 Squeak Mailing Lists
# https://wiki.squeak.org/squeak/775 FAQ: Mailing List Archives

# http://lists.squeakfoundation.org/mailman/listinfo/beginners
# http://lists.squeakfoundation.org/pipermail/beginners/ (archive)

# http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/squeak-dev
# http://lists.squeakfoundation.org/pipermail/squeak-dev/ (archive)

# http://lists.squeakfoundation.org/pipermail/beginners/2023-January/010308.html 3D?
# http://lists.squeakfoundation.org/pipermail/beginners/2023-January/010309.html RET




#####
#
# irc
# 2023jan27
#
#####

# «irc»  (to ".irc")
# (find-es "rcirc" "oftc")
# https://wiki.squeak.org/squeak/1915 Squeak on IRC
# https://wiki.squeak.org/squeak/5888 IRC Portal

(defun sq2 () (interactive) (find-libera-2a "#squeak"))
(defun sq3 () (interactive) (find-libera-3a "#squeak"))




#####
#
# tutorials
# 2022mar02
#
#####

# «tutorials»  (to ".tutorials")
# https://wiki.squeak.org/squeak/792 Squeak Tutorials
# https://wiki.squeak.org/squeak/6622 Learning Squeak in 2020 ***
# https://wiki.squeak.org/squeak/792#eToys
# https://wiki.squeak.org/squeak/792#Morphic
# https://wiki.squeak.org/squeak/792#Seaside
# https://en.scratch-wiki.info/wiki/Squeak_Tutorial
# https://wiki.squeak.org/squeak/3501 Discovering Better Code: Bowling for Smalltalk Series
# https://wiki.squeak.org/squeak/795 Morphic Tutorial: Build a 4 digit LED counter
# https://wiki.squeak.org/squeak/1827 Counter Tutorial: A Morphic Fascination ***
# http://www.jvuletich.org/Squeak/IntroductionToMorphic/Morphic.html
# http://www.jvuletich.org/Squeak/IntroductionToMorphic/Morphic-Playing.html
# http://wiki.squeak.org/squeak/1175 Fabrik




#####
#
# Squeak by Example
# 2023jan22
#
#####

# «squeak-by-example»  (to ".squeak-by-example")
# (find-books "__comp/__comp.el" "squeak-by-example")
# (find-es "pharo" "pharo-by-example")
# https://github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3.1/SBE-5.3.pdf

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cp -v $S/https/github.com/hpi-swa-lab/SqueakByExample-english/releases/download/5.3.1/SBE-5.3.pdf \
   ~/SQUEAK/squeak-by-example-5.3.pdf
cd ~/SQUEAK/
scp squeak-by-example-5.3.pdf $LINS/SQUEAK/
scp squeak-by-example-5.3.pdf $LINP/SQUEAK/

* (eepitch-linode)
* (eepitch-kill)
* (eepitch-linode)
mkdir -p ~/public_html/SQUEAK/
mkdir -p   ~/slow_html/SQUEAK/
# (find-linodepfile   "SQUEAK/")
# (find-linodesfile   "SQUEAK/")


# Old:
# https://open.umn.edu/opentextbooks/textbooks/313
# https://pdxscholar.library.pdx.edu/compsci_fac/110/
# https://pdxscholar.library.pdx.edu/cgi/viewcontent.cgi?article=1112&context=compsci_fac PDF
# https://pdxscholar.library.pdx.edu/Squeak_by_Example.pdf (fake URL)
# https://github.com/SquareBracketAssociates/SqueakByExample-english

# (find-squeakbyexpage (+ 14 9) "new morph" "alphabetical list")
# (find-squeakbyextext (+ 14 9) "new morph" "alphabetical list")

world -> old desktop menu (W) -> new morph -> from alphabetical list




#####
#
# Squeak by Example: testShout and shout
# 2023jan25
#
#####

# «squeak-shout»  (to ".squeak-shout")
# (find-squeakbyexpage (+ 14 22) "Method 1.1: A test for a shout method")
# (find-squeakbyextext (+ 14 22) "Method 1.1: A test for a shout method")
# (find-squeakbyexpage (+ 14 25) "Method 1.2: The shout method")
# (find-squeakbyextext (+ 14 25) "Method 1.2: The shout method")

String
String browse      'converting -> shout'
StringTest browse  'tests - converting -> testShout'

testShout
   self assert: ('Don''t panic' shout = 'DON''T PANIC!')

shout
   ^ self asUppercase, '!'




#####
#
# openInWorld
# 2023feb21
#
#####

# «openInWorld»  (to ".openInWorld")
# (find-squeakbyexpage (+ 16 33) "self openInWorld")
# (find-squeakbyextext (+ 16 33) "self openInWorld")

See cm: (Morph >> #openInWorld).
See cm: (Morph >> #openInWorld:).



#####
#
# addAlarm:
# 2023feb21
#
#####

# «addAlarm:»  (to ".addAlarm:")
# (find-TH "eev-squeak" "addAlarm")
# (find-squeakfile "See.st")
# (find-squeakfile "See.st" "run: aBlock after: ms")
# How do I "sleep 5"?
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223483.html Edrx 1
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223484.html Vanessa 2
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223486.html Edrx 3
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223487.html Karl 4
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223488.html Edrx 5
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223490.html Marcel 6
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223502.html Karl 7
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223518.html STPope 8

See cm: (Morph >> #addAlarm:after:).
See cm: (Morph >> #addAlarm:withArguments:after:).
See cm: (Morph >> #addAlarm:with:after:).
See cm: (Morph >> #addAlarm:with:with:after:).

"Create a SimpleSwitchMorph with label 'Toggle'
    and a SimpleButtonMorph with label 'Flash'.
    The button will be placed below the switch."

sm := SimpleSwitchMorph new.
sm openInWorld.
bm := SimpleButtonMorph new.
bm openInWorld.
bm position: bm position + (0@32).

"Three ways of toggling the color of the switch:"

sm toggleState.

bl := [ sm toggleState ].
bl value.

bm target: bl.
bm actionSelector: #value.
bm doButtonAction.

"Two ways of toggling the switch after 1000ms:"

sm addAlarm: #toggleState after: 1000.
bm addAlarm: #doButtonAction after: 1000.


"Save the keyboard focus in kf after 5s:"

kf := 0.
bl := [ sm toggleState ].
bl := [ kf := self currentHand keyboardFocus ].
bm target: bl.
bm actionSelector: #value.
bm addAlarm: #doButtonAction after: 5000.

kf.

and now I can simply run this

  See run: [ kf := self currentHand keyboardFocus ] after: 5000.

to save into the variable kf the morph on which the keyboard focus is
after 5 second. Neat! =)

  Cheers,
    Eduardo Ochs
    http://anggtwu.net/eev-squeak.html








#####
#
# resetHandlerFields
# 2023feb20
#
#####

# «resetHandlerFields»  (to ".resetHandlerFields")
# (find-squeaksharedfile "")
# (find-squeaksharedfile "See class-accessing.st")

See cm: (HandMorphForReplay >> #processEvents).
See cm: (MorphicEvent   >> #resetHandlerFields).
See cm: (UserInputEvent >> #resetHandlerFields).
See cm: (DropEvent      >> #resetHandlerFields).

See store: Dictionary new.

ar := Array with: 50@100 with: 200@300 with: 100@400.
pm := (PolygonMorph
        vertices: ar color: Color red
        borderWidth: 1 borderColor: Color black).
eh := EventHandler new.
bl := [ :evt :sm | self halt. Transcript show: { evt . sm }; cr. ].
pm eventHandler: eh.
eh on: #keyStroke send: #value:value: to: bl.

World addMorph: pm.
See keyboardFocus: pm.

"Run this in PolygonMorph -> debugger:"
See at: #CR put: evt.
"Go back to the workspace, and then do:"

evt := See at: #CR.
evt.
evt wasHandled.
evt resetHandlerFields.
evt wasHandled.
pm handleEvent: evt.



 sendFilterEventBubble: anEvent for: self.

See cm: (TextMorphForEditView >> keyStroke:).
evt keyCharacter: Character cr.
TextEditor>>#accept

kf explore.
kf editor.
kf editor accept.





#####
#
# SimpleSwitchMorph
# 2023feb21
#
#####

# «SimpleSwitchMorph»  (to ".SimpleSwitchMorph")
# (find-books "__comp/__comp.el" "squeak-by-example" "The Quinto game")
# (find-squeakbyexpage (+ 16 29) "SimpleSwitchMorph")
# (find-squeakbyextext (+ 16 29) "SimpleSwitchMorph")

See class: SimpleSwitchMorph
See cm: (SimpleSwitchMorph >> #initializeWithLabel:).

sm := SimpleSwitchMorph new.
sm openInWorld.

sm initialize.
sm label: '';
   borderWidth: 2;
   bounds: (0 @ 0 corner: 16 @ 16);
   offColor: Color cantaloupe;
   onColor: Color aqua;
   useSquareCorners.
sm turnOff.
sm turnOn.

sm := SimpleSwitchMorph new.
sm openInWorld.
sm label: 'A'.
sm toggleState.
sm addAlarm: #toggleState after: 1000.

bl := [ :evt :sm | Transcript show: { evt . sm }; cr. ].
eh := EventHandler new.
eh on: #keyStroke send: #value:value: to: bl.




#####
#
# SimpleButtonMorph
# 2023feb21
#
#####

# «SimpleButtonMorph»  (to ".SimpleButtonMorph")

See class: SimpleButtonMorph
See cm:   (SimpleButtonMorph >> #label:).
See cm:   (SimpleButtonMorph >> #browseImplementationOfActionSelector).
See cm:   (SimpleButtonMorph >> #target:).
See cm:   (SimpleButtonMorph >> #doButtonAction).

bm := SimpleButtonMorph new.
bm openInWorld.
bm label: 'Foo'.
bm doButtonAction.

rm := RectangleMorph new.
rm openInWorld.
rm color: Color red.

bm position: bm position + (0@16).

sm := SimpleSwitchMorph new.
sm openInWorld.
sm addAlarm: #toggleState after: 1000.

bm := SimpleButtonMorph new.
bm openInWorld.
bm position: bm position + (0@32).

bm label: 'Foo'.
bm doButtonAction.




Hi Vanessa!
Thanks! =) This works in a workspace,

  "Create a SimpleSwitchMorph with label 'Toggle'
      and a SimpleButtonMorph with label 'Flash'.
      The button will be placed below the switch."
  
  sm := SimpleSwitchMorph new.
  sm openInWorld.
  bm := SimpleButtonMorph new.
  bm openInWorld.
  bm position: bm position + (0@32).
  
  "Three ways of toggling the color of the switch:"
  
  sm toggleState.
  
  bl := [ sm toggleState ].
  bl value.
  
  bm target: bl.
  bm actionSelector: #value.
  bm doButtonAction.
  
  "Two ways of toggling the switch after 1000ms:"
  
  sm addAlarm: #toggleState after: 1000.
  bm addAlarm: #doButtonAction after: 1000.

but this doesn't:

  bm2 := SimpleButtonMorph new.
  bm2 target: bl.
  bm2 actionSelector: #value.
  bm2 addAlarm: #doButtonAction after: 1000.

What is the right way to add an alarm to a morph that is not shown on
the screen? Also, can I create a new invisible morph every time that I
want to run an alarm? Are they going to be garbage collected?

  Thanks in advance!
    Eduardo Ochs
    http://anggtwu.net/eev-squeak.html




Hi Vanessa!



https://www.youtube.com/watch?v=BNjgltkqTzc



sm addAlarm: #toggleState after: 1000.




self halt.
bm doButtonAction.
bm explore.
bm class browse.

bl := [ sm toggleState ].
bl value.
bm target: bl.
bm actionSelector: #value.

sm addAlarm: #toggleState after: 1000.
bm addAlarm: #doButtonAction after: 1000.






#####
#
# Matrix
# 2023feb25
#
#####

# «Matrix»  (to ".Matrix")

See cm: (SequenceableCollectionTest >> #testPreMultiplyByMatrix).
See cm: (Matrix >> #preMultiplyByMatrix:).
See class: Matrix.




#####
#
# quinto
# 2023jan25
#
#####

# «quinto»  (to ".quinto")
# (find-squeakbyexpage (+ 14 33) "Method 2.2: Initializing instances of SBECell")
# (find-squeakbyextext (+ 14 33) "Method 2.2: Initializing instances of SBECell")

initialize
  super initialize.
  self label: ''.
  self borderWidth: 2.
  bounds := 0@0 corner: 16@16.
  offColor := Color paleYellow.
  onColor := Color paleBlue darker.
  self useSquareCorners.
  self turnOff

# (find-squeakbyexpage (+ 14 36) "Method 2.4: Initializing the game")
# (find-squeakbyextext (+ 14 36) "Method 2.4: Initializing the game")

initialize
  | sampleCell width height n |
  super initialize.
  n := self cellsPerSide.
  sampleCell := SBECell new.
  width := sampleCell width.
  height := sampleCell height.
  self bounds: (5@5 extent: ((width*n) @(height*n)) + (2 * self borderWidth)).
  cells := Matrix new: n tabulate: [ :i :j | self newCellAt: i at: j ].

# (find-squeakbyexpage (+ 14 40) "Method 2.5: A constant method")
# (find-squeakbyextext (+ 14 40) "Method 2.5: A constant method")

cellsPerSide
 "The number of cells along each side of the game"
 ^ 10

# (find-squeakbyexpage (+ 14 40) "Method 2.6: An initialization helper method")
# (find-squeakbyextext (+ 14 40) "Method 2.6: An initialization helper method")

newCellAt: i at: j
 "Create a cell for position (i,j) and add it to my on--screen
 representation at the appropriate screen position. Answer the new cell"
 | c origin |
 c := SBECell new.
 origin := self innerBounds origin.
 self addMorph: c.
 c position: ((i - 1) * c width) @ ((j - 1) * c height) + origin.
 c mouseAction: [self toggleNeighboursOfCellAt: i at: j].

# (find-squeakbyexpage (+ 14 41) "Method 2.7: The callback method")
# (find-squeakbyextext (+ 14 41) "Method 2.7: The callback method")

toggleNeighboursOfCellAt: i at: j
 (i > 1) ifTrue: [ (cells at: i - 1 at: j ) toggleState].
 (i < self cellsPerSide) ifTrue: [ (cells at: i + 1 at: j) toggleState].
 (j > 1) ifTrue: [ (cells at: i at: j - 1) toggleState].
 (j < self cellsPerSide) ifTrue: [ (cells at: i at: j + 1) toggleState].

# (find-squeakbyexpage (+ 14 41) "Method 2.8: A typical setter method")
# (find-squeakbyextext (+ 14 41) "Method 2.8: A typical setter method")

SBECell»mouseAction: aBlock
  ^ mouseAction := aBlock

# (find-squeakbyexpage (+ 14 42) "Method 2.9: An event handler")
# (find-squeakbyextext (+ 14 42) "Method 2.9: An event handler")

SBECell»mouseUp: anEvent
  mouseAction value


String
String browse
StringTest browse

SBECell new
SBECell new openInWorld
SBEGame new openInWorld

# (find-fline "~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/shared/SBE-Quinto.st")




#####
#
# books
# 2023feb20
#
#####

# «books»  (to ".books")
# (find-books "__comp/__comp.el" "smalltalk")
# https://wiki.squeak.org/squeak/689 Smalltalk & Squeak books
# https://wiki.squeak.org/squeak/471 Squeak FAQ
# http://stephane.ducasse.free.fr/FreeBooks.html
# https://rmod-files.lille.inria.fr/FreeBooks/BlueBookHughes/Design%20Principles%20Behind%20Smalltalk.pdf
# https://rmod-files.lille.inria.fr/FreeBooks/SmalltalkHistoryHOPL.pdf

https://rmod-files.lille.inria.fr/FreeBooks/ByExample/CodeExamples.zip
https://rmod-files.lille.inria.fr/FreeBooks/ByExample/25%20-%20Chapter%2023%20-%20Model-View-Controller.pdf

https://rmod-files.lille.inria.fr/FreeBooks/ByExample/SmalltalkByExampleON2.pdf
https://rmod-files.lille.inria.fr/FreeBooks/ByExample/SmalltalkByExampleNewRelease.pdf
https://rmod-files.lille.inria.fr/FreeBooks/InsideST/InsideSmalltalk.pdf
https://rmod-files.lille.inria.fr/FreeBooks/InsideST/InsideSmalltalkII.pdf
https://rmod-files.lille.inria.fr/FreeBooks/PracticalSmalltalk/PracticalSmalltalk.pdf
https://rmod-files.lille.inria.fr/FreeBooks/HopkinsHoran/HopkinsHoran.pdf


;; (find-stbyexpage)
;; (find-stbyextext)




#####
#
# Point3D
# 2023jan27
#
#####

# «Point3D»  (to ".Point3D")
# (find-fline "~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/shared/")
# (find-squeaksharedfile "")
# (find-squeaksharedfile "Category-Edrx.st")




#####
#
# OSProcess
# 2023jan28
#
#####

# «OSProcess»  (to ".OSProcess")
# https://wiki.squeak.org/squeak/708 OSProcess
# (find-squeaksharedfile "")
# (find-squeaksharedfile "See.st")
# (find-squeaksharedfile "See.st" "\nemacsClientEval: string")




#####
#
# CommandShell
# 2023jan27
#
#####

# «CommandShell»  (to ".CommandShell")
# https://wiki.squeak.org/squeak/1914 CommandShell
# https://wiki.squeak.org/squeak/6023 ExternalCommandShell
# https://wiki.squeak.org/squeak/2153 Overview of CommandShell
# https://wiki.squeak.org/squeak/1064 CommandShell exercise
# http://www.squeaksource.com/CommandShell/
# https://wiki.squeak.org/squeak/2819 Invoking Lua from Squeak using OSProcess Command shell

<krono> something like #wait, #exec:withArguments: 🤔

# (find-fline "~/LOGS/2023jan27.squeak2")








#####
#
# See
# 2023jan28
#
#####

# «See»  (to ".See")
# (find-squeaksharedfile "")
# (find-squeaksharedfile "See.st")
# (find-squeaksharedfile "See.st" "\nitem1tsa: menu")

See>>sbep0: page
  "See the method sbep:."
  ^ 'emacsclient --eval ''(find-squeakbyexpage ' , page , ')'''.

See>>sbep: page
  "Open the book Squeak by Example on a certain page"
  OSProcess waitForCommand: (See sbep0: page).



#####
#
# See.st.html
# 2023jan28
#
#####

# «See.st.html»  (to ".See.st.html")
# (find-squeaksharedfile "")
# (find-es "htmlize" "engrave-faces-git")
# (find-angg ".emacs" "squeak")
# (find-engrave-faces-links "SQUEAK/Squeak6.0-22104/shared/" "SQUEAK/" "See.st")
# (find-engrave-faces-links "SQUEAK/Squeak6.0-22104/shared/" "SQUEAK/" "Category-Edrx.st")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -fv ~/SQUEAK/See.st
rm -fv ~/SQUEAK/See.st.html
cp -v  ~/SQUEAK/Squeak6.0-22104/shared/See.st ~/SQUEAK/
cd     ~/SQUEAK/Squeak6.0-22104/shared/
laf
laf    ~/SQUEAK/

* (defun a () (interactive) (eek "M-x engrave-faces-html-buffer-standalone RET"))
* (defun b () (interactive) (eek "C-x C-w ~/SQUEAK/See.st.html RET"))
* (find-2b nil '(find-fline "~/SQUEAK/See.st"))

On the other window, run:
  M-x engrave-faces-html-buffer-standalone
  C-x C-w ~/SQUEAK/See.st.html

# file:///home/edrx/SQUEAK/See.st.html
# http://anggtwu.net/SQUEAK/See.st.html
# http://anggtwu.net/SQUEAK/See.st




#####
#
# CompiledMethod
# 2023feb18
#
#####

# «CompiledMethod»  (to ".CompiledMethod")
# (find-squeaksharedfile "")
# (find-squeakfile "")

cm := (HandMorph >> #processEvents).
cm class.
See class: CompiledMethod.
cm method.
cm searchForSelector.

See class: CompiledMethod.
See cm: (CompiledMethod >> searchForSelector).
See cm: (Behavior >> #>>).
See cm: (See class >> #cm:).



SystemBrowser default fullOnClass:selector:

See cm: (Browser class >> #fullOnClass:selector:).




#####
#
# fileOut-format
# 2023jan28
#
#####

# «fileOut-format»  (to ".fileOut-format")
# http://wiki.squeak.org/squeak/1105 FAQ: FileOut Code Format

# (find-squeaksharedfile "TestMorph.st")

Morph subclass: #TestMorph
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Category-Edrx'!

!TestMorph methodsFor: 'as yet unclassified' stamp: 'Edrx 1/30/2023 19:34'!

See class: Class method: #subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:.
See class: ClassDescription method: #methodsFor:.
See class: ClassDescription method: #methodsFor:stamp:.
See class: ClassBuilder.
See class: ClassCategoryReader.





#####
#
# menuitem-action
# 2023jan28
#
#####

# «menuitem-action»  (to ".menuitem-action")
# (find-squeaksharedfile "See.st" "\nitem1tsa: menu")
# (find-squeakbyexpage (+ 14 35) "openInWorld")
# (find-squeakbyextext (+ 14 35) "openInWorld")

See class: Morph method: #openInWorld.



#####
#
# openSelectorBrowser
# 2023jan28
#
#####

# «openSelectorBrowser»  (to ".openSelectorBrowser")
# «ToolBuilder»          (to ".ToolBuilder")
# (find-squeaksharedfile "See.st" "\nmethodFinder")
# (find-fline "~/LOGS/2023jan28.squeak")
# https://wiki.squeak.org/squeak/5607 ToolBuilder
# https://wiki.squeak.org/squeak/4194 SelectorBrowser
# http://www.squeaksource.com/ToolBuilder/
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-January/218359.html

See methodFinder.
See class: See classMethod: #methodFinder. "(uses ECToolSet)"
See class: ECToolSet.
See class: ECToolSet classMethod: #openSelectorBrowser. "(fails)"
ECToolSet superclass.
See class: StandardToolSet.
See class: StandardToolSet classMethod: #openSelectorBrowser.
See class: ToolBuilder.

See class: SelectorBrowser.
See class: SelectorBrowser method: #byExample.
See class: SelectorBrowser method: #byExample:.
See class: SelectorBrowser classMethod: #prototypicalToolWindow.

SelectorBrowser prototypicalToolWindow.
SelectorBrowser prototypicalToolWindow openInWorld.

sb := SelectorBrowser prototypicalToolWindow.
sb := SelectorBrowser prototypicalToolWindow openInWorld.
sb explore.
(sb submorphs at: 4) editString: 'foo'.
(sb submorphs at: 4) editString: 'bar'.




#####
#
# squeaksource
# 2023jan26
#
#####

# «squeaksource»  (to ".squeaksource")
# (find-squeakbyexpage (+ 14 48) "www.squeaksource.com")
# (find-squeakbyextext (+ 14 48) "www.squeaksource.com")

Eduardo Ochs
Edrx
S4




#####
#
# Where changes and screenshots are saved
# 2023jan25
#
#####

# «changes-and-screenshots»  (to ".changes-and-screenshots")
# (find-sh "find ~/SQUEAK/ -mtime 0")
# (find-fline "~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/shared/" "changes")
# (find-fline "~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/shared/" "SqueakScreen.1.png")




#####
#
# My question on IRC about #commandKeyHelp
# 2023jan27
#
#####

# «commandKeyHelp»  (to ".commandKeyHelp")
# (find-fline "~/LOGS/2023jan27.squeak" "xxx commandKeyHelp")

...here are the details.
I clicked on the Help menu,
then used the halo twice to select just the line in it
that says "Keyboard Shortcuts",
then I duplicated it...

and I got a menu with just one item -
"Keyboard Shortcuts".

I use the halo on it
and then the wrench
and I get a menu
whose fourth option is "Explore Morph".
I choose that and
I get an explorer
whose title is: a MenuMorph<Menu>(1170696)

I open submorphs -> 1 -> extension,
and I get this...
the fields in red look promising -
let me send a screenshot first -

  https://i.ibb.co/xh77cy6/sshot.png
  http://anggtwu.net/tmp/squeak-2023jan27-question1.png

and then let me see if I can discover
how to use the symbol #commandKeyHelp
in submorphs -> 1 -> selector...

hmm, my problem now is to find an object xxx
such that running

  xxx commandKeyHelp

would open the "Keyboard Shortcuts" menu.

I used the search bar on commandKeyHelp
and I found that there is one "implementor" for that method...
and I got these two expressions that
I can put in a workspace and execute with C-d,
and that would open system browsers in the right places...

  TheWorldMainDockingBar browse

  SystemBrowser default fullOnClass: TheWorldMainDockingBar
       selector: #commandKeyHelp




self.
self submorphs.
(self submorphs at: 1).
(self submorphs at: 1) contents.
(self submorphs at: 1) selector.
(self submorphs at: 1) target.
(self submorphs at: 1) target commandKeyHelp.


SystemBrowser default fullOnClass: Point3D selector: #asString
SystemBrowser browse




#####
#
# Squeak 3.6
# 2004feb29
#
#####

# «squeak-3.6»  (to ".squeak-3.6")
# Obsolete, deleted



#####
#
# learning squeak
# 2004mar11
#
#####

# «learn-squeak»  (to ".learn-squeak")
# Squeak FAQ: <http://minnow.cc.gatech.edu/squeak/471>
# (find-w3m "/home/edrx/snarf/http/minnow.cc.gatech.edu/squeak/471")

(defun find-sqsrc (&rest rest)
  (find-fline "~/.squeak/srcs")
  (setq tab-width 2)
  (apply 'ee-goto-position rest))

(defun find-sqchg (&rest rest)
  (find-fline "~/.squeak/chgs")
  (setq tab-width 2)
  (apply 'ee-goto-position rest))

# (find-sqsrc "inspect it (i)")
# (find-sqsrc "TextEditorYellowButtonMenu _ SelectionMenu")
# (find-sqsrc "printIt: characterStream")
# (find-sqsrc "evalString:")
# (find-sqsrc "\nbrowseAllClasses")

# (find-sqchg "A Browser is a tool")
# (find-sqchg 0)


#*
# (find-fline "~/.squeak/")
cd ~/.squeak/
tr \\\r \\\n < squeak.changes   > chgs
tr \\\r \\\n < SqueakV3.sources > srcs
mkdir chg src

#*
# (find-lua50ref "string.find")

cd ~/.squeak/chg/
lua50e '
sources = {}
class = nil
_, __, class_ = string.find(

add = function (class, line)
  
'

# (find-gstnode "A new class")
# (find-gstnode "Defining methods")
# (find-gstnode "The syntax")
# (find-gstnode "The syntax" "#at:put:")

1 to: 62 do: [:j |
	bestIndex = 63 ifTrue: [
		(stepSizeTable at: j) >= diff ifTrue: [bestIndex _ j]]].
	^ bestIndex

# (find-fline "~/.squeak/")




#####
#
# learning squeak
# 2004mar11
#
#####

# «learn-squeak»  (to ".learn-squeak")
# Squeak FAQ: <http://minnow.cc.gatech.edu/squeak/471>
# (find-w3m "/home/edrx/snarf/http/minnow.cc.gatech.edu/squeak/471")

(defun find-sqsrc (&rest rest)
  (find-fline "~/.squeak/srcs")
  (setq tab-width 2)
  (apply 'ee-goto-position rest))

(defun find-sqchg (&rest rest)
  (find-fline "~/.squeak/chgs")
  (setq tab-width 2)
  (apply 'ee-goto-position rest))

# (find-sqsrc "inspect it (i)")
# (find-sqsrc "TextEditorYellowButtonMenu _ SelectionMenu")
# (find-sqsrc "printIt: characterStream")
# (find-sqsrc "evalString:")
# (find-sqsrc "\nbrowseAllClasses")

# (find-sqchg "A Browser is a tool")
# (find-sqchg 0)


#*
# (find-fline "~/.squeak/")
cd ~/.squeak/
tr \\\r \\\n < squeak.changes   > chgs
tr \\\r \\\n < SqueakV3.sources > srcs
mkdir chg src

#*
# (find-lua50ref "string.find")

cd ~/.squeak/chg/
lua50e '
sources = {}
class = nil
_, __, class_ = string.find(

add = function (class, line)
  
'

# (find-gstnode "A new class")
# (find-gstnode "Defining methods")
# (find-gstnode "The syntax")
# (find-gstnode "The syntax" "#at:put:")

1 to: 62 do: [:j |
	bestIndex = 63 ifTrue: [
		(stepSizeTable at: j) >= diff ifTrue: [bestIndex _ j]]].
	^ bestIndex

# (find-fline "~/.squeak/")




#####
#
# squeak from the debianized sources
# 2004dec15
#
#####

# «squeak-sarge»  (to ".squeak-sarge")
# http://wiki.squeak.org/squeak/3616 Squeak for Debian Users
# "the Debian packages have not been updated in over a decade and are very seriously out of date"
# Obsolete, deleted



#####
#
# Squeak 3.6
# 2004feb29
#
#####

# «squeak-3.6»  (to ".squeak-3.6")
# Obsolete, deleted




#####
#
# the Squeak VM
# 2005jan06
#
#####

# «squeak-vm»  (to ".squeak-vm")
# Obsolete, deleted




#####
#
# squeak for debian, again (2006)
# 2006aug11
#
#####

# «squeak-debian-2006»  (to ".squeak-debian-2006")
# (find-angg ".zshrc" "mysqueak")
# Obsolete, deleted




#####
#
# squeak on etch
# 2007jun30
#
######

# «squeak-on-etch»  (to ".squeak-on-etch")
# Obsolete, deleted





#####
#
# squeak and binfmts
# 2007jul01
#
#####

# «squeak-binfmts»  (to ".squeak-binfmts")
# Obsolete, deleted




#####
#
# install-2023
# 2023jan28
#
#####

# «install-2023»  (to ".install-2023")
# (find-angg ".zshrc" "mysqueak")
# (find-es "unix" "tar")
# (find-fline "~/SQUEAK/")
# (find-fline "~/SQUEAK/Squeak6.0-22104/")
# https://squeak.org/downloads/
# https://files.squeak.org/6.0/Squeak6.0-22104-64bit/Squeak6.0-22104-64bit-202206021410-Linux-x64.tar.gz

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SQUEAK/
tar -tvzf $S/https/files.squeak.org/6.0/Squeak6.0-22104-64bit/Squeak6.0-22104-64bit-202206021410-Linux-x64.tar.gz
rm -Rv   ~/SQUEAK/Squeak6.0*
mkdir -p ~/SQUEAK/Squeak6.0-22104/
tar -C   ~/SQUEAK/Squeak6.0-22104/ \
    --strip-components=1 \
    -xvzf $S/https/files.squeak.org/6.0/Squeak6.0-22104-64bit/Squeak6.0-22104-64bit-202206021410-Linux-x64.tar.gz

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd  ~/SQUEAK/Squeak6.0-22104/
./squeak.sh

# (find-angg ".zshrc" "mysqueak")
# (code-c-d "squeakshared" "~/SQUEAK/Squeak6.0-22104/shared/")
# (find-squeaksharedfile "")
# (find-squeaksharedsh "strings release-notes/6.0")
# (find-squeaksharedsh "find * | sort")




#####
#
# install-2022
# 2022feb25
#
#####

# «install-2022»  (to ".install-2022")
# http://wiki.squeak.org/squeak/3616 the Debian packages have not been updated in over a decade
# https://squeak.org/downloads/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SQUEAK/Squeak6.0-22104-64bit-202206021410-Linux-x64/ && ./squeak.sh

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/SQUEAK/
wget -nc http://files.squeak.org/5.3/Squeak5.3-19459-64bit/Squeak5.3-19459-64bit-202003021730-Linux.zip
rm -Rv ~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/
unzip Squeak5.3-19459-64bit-202003021730-Linux.zip


* (eepitch-shell3)
* (eepitch-kill)
* (eepitch-shell3)
# (find-fline "~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/")
cd             ~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/
./squeak.sh




#####
#
# smalltalkeditor-feb2022
# 2022feb25
#
#####

# «smalltalkeditor-feb2022»  (to ".smalltalkeditor-feb2022")
# (find-fline "/tmp/emacs-squeak.txt")
# (find-fline "~/SQUEAK/" "SmalltalkEditor.st")
# (find-fline "~/SQUEAK/SmalltalkEditor.st")
# (find-fline "~/SQUEAK/SmalltalkEditor.st" "\ninitializeCmdKeyShortcuts")

See class: SmalltalkEditor classMethod: #initializeCmdKeyShortcuts.
See class: TextEditor classMethod: #initializeCmdKeyShortcuts.
See class: Editor classMethod: #initialize.
See class: Editor classMethod: #initializeKeystrokeActions.
TextEditor cmdActions

See class: SelectorBrowser.
See class: SelectorBrowser method: #buildEditViewWith:.
See class: SelectorBrowser classMethod: #buildEditViewWith:.



Okay!
  SmalltalkEditor.st 14.0 KB
I had to remind myself of a lot of things (it's been years)
sorry it took so long
Okay download this, then in your Squeak:
Tools menu, select File List
and browse to where you downloaded this file
Click it, then click the filein button


Okay cool
One last step
Go to the tools menu and open a workspace and a transcript
in either of them: 
  SmalltalkEditor initialize
and hit C-d
Now here's what should happen: C-e should inject the contents of /tmp/emacs-squeak.txt and point; C-E should write the selection to the same file
So you could test by selecting some text and hitting C-E, then seeing whether that file exists from Emacs
(and if so, editing it there, saving, and hitting C-e in the workspace)
you should see a little notification in the Transcript

FANTASTIC!!!

Does it work?

Perfectly!!!!!!!!!! =) =) =)

Yay

If you want separate files that's a  trivial change

No, it's better that way!!!

one last thing: try C-d on "SmalltalkEditor browse" (no quotes) and ensure the instance (rather than class) button is clicked
look for methods emacsIn and emacsOut
FWIW the time consuming thing here was figuring out how to rebind, and looking at the editor API to see how to grab the selection or insert at point
It's probably been 17 years since I dug around the system in this way so I've forgotten everything




#####
#
# tweaks.cs
# 2022feb28
#
#####

# «tweaks.cs»  (to ".tweaks.cs")
# (find-fline "~/SQUEAK/tweaks.st")

; install this
(find-epackage-links 'smalltalk-mode)
; save this somewhere
(find-wget "https://0branch.com/snippets/tweaks.cs")
;; now in squeak: tools menu -> file list -> browse to file -> filein




#####
#
# autocompletion
# 2022mar04
#
#####

# «autocompletion»  (to ".autocompletion")

Tools -> Preferences -> search -> completion
Tools -> Preferences -> search -> color -> Color Preference Example
Extras -> Themes and colors -> Squeak (duller)
Squeak -> Tutorials -> Useful expressions
Apps -> Preference wizard
  update + completion



#####
#
# Tools-menu
# 2023jan29
#
#####

# «Tools-menu»  (to ".Tools-menu")

The Tools menu:
{'Browser' . StandardToolSet . #openClassBrowser . nil} 
{'Workspace' . StandardToolSet . #openWorkspace . nil} 
{'Transcript' . [closure] in [] in TheWorldMainDockingBar>>transcriptMenuItemOn: . #value . nil}
{'Test Runner' . TestRunner . #open . nil}
{'Method Finder' . StandardToolSet . #openSelectorBrowser . nil}
{'Message Names' . StandardToolSet . #openMessageNames . nil}
{'Simple Change Sorter' . ChangeSorter . #open . nil}
{'Dual Change Sorter' . DualChangeSorter . #open . nil}
{'Monticello Browser' . MCWorkingCopyBrowser . #open . nil}
{'Git Browser' . a TheWorldMainDockingBar . #installAndOpenGitBrowser . nil}
{'Squeak Inbox Talk (click to install)' . a TheWorldMainDockingBar . #installAndOpenSqueakInboxTalk . nil}
{'Process Browser' . ProcessBrowser . #open . nil}
{'Preferences' . PreferenceBrowser . #open . nil}
{'File List' . StandardToolSet . #openFileList . nil}



#####
#
# Workspace
# 2023feb20
#
#####

# «Workspace»  (to ".Workspace")
aaaa := 42
self model bindings at: #aaaa




#####
#
# openWorkspace
# 2023feb10
#
#####

# «openWorkspace»  (to ".openWorkspace")

See class: StandardToolSet classMethod: #openWorkspace.
See class: Workspace classMethod: #open.
StandardToolSet openWorkspace.
Workspace open.
Workspace new buildAndOpen.

w := Workspace new.
w buildAndOpen.
w inspect.

p := PluggableListMorphPlus new.
p buildAndOpen.

See class: SystemWindow.
See class: PluggableSystemWindow.
See cm: (SystemWindow >> #openAsTool).
See cm: (PluggableSystemWindowWithLabelButton >> #replaceBoxes).

Project uiManager openToolsAttachedToMouseCursor
Project uiManager openToolsAttachedToMouseCursor

See cm: (Project >> #uiManager).
See cm: (Project class >> #uiManager).

w := Workspace new.
self halt.
w buildAndOpen.
w inspect.
w explore.
w dependents explore.
(w dependents at: 2) explore.
(w dependents at: 2) bounds.




#####
#
# Where does the compiler handle the "local bindings" of workspaces?
# 2023feb26
#
#####

# «workspaces-compiler»  (to ".workspaces-compiler")
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223560.html Edrx 1
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223561.html Karl 2
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223565.html Edrx 3
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223578.html Karl 4
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223579.html Edrx 5

# (find-squeaksharedfile "Compiler.st")
# (find-squeaksharedfile "CompilationCue.st")
# (find-squeaksharedfile "Environment.st")

Hi list,

first some context:

  I was trying to put some blocks of executable notes in something
  like the "Terse Guide to Squeak"... the Terse Guide is implemented
  as a class called TerseGuideHelp, and I was working on a modified
  copy of that class, that I called EdrxGuideHelp... but then I saw
  that the window that shows the content of a topic in a help browser
  treats local variables in a way that is different than the one in
  workspaces - if I run "a := 42" in the window with the contents of a
  topic I get a dialog window whose title is:

    Unknown variable: a!
    please correct, or cancel:

Now a more basic question. I sort of know where the "local variables"
of a workspace are stored... if I start with a single workspace and I
run this on it,

  w := Workspace new.
  w buildAndOpen.

and then I run this on the second workspace,

  a := 2.
  b := a + 3.

and then go back to the first workspace and "print it" this,

  w bindings.

I get:

 a Dictionary('a'->2 'b'->5 )

My first guess was that "do it"s and "print it"s in a workspace use
a dictionary of bindings, but "do it"s and "print it"s in the
mini-workspace of a help browser do not. I tried to understand
"real" workspaces first, and after setting a breakpoint in

  TextEditor >> #printIt

and doing lots of single-steppings I arrived at this method,

  TextEditor >> #evaluateSelectionAndDo:

that has this:

    result := [
        rcvr class evaluatorClass new
            evaluate: self selectionAsStream
            in: ctxt
            to: rcvr
            environment: (model environment ifNil: [Smalltalk globals])
            notifying: self
            ifFail: [self flash. ^ nil]
            logged: true.
    ] 
        on: OutOfScopeNotification 
        do: [ :ex | ex resume: true].

but when that code calls this method

  Compiler >> #evaluate:in:to:environment:notifying:ifFail:logged:

the "rcvr class evaluatorClass new" is simply a "Compiler new", "self
selectionAsStream" is "a := 2. b := a + 3." as a stream, the ctxt and
the rcvr are nil, and the environment is just "Smalltalk"... where
does the dictionary of local bindings enter the story? Am I doing
something wrong in the debugger?...

  Thanks in advance!
    Eduardo Ochs
    http://angg.twu.net/eev-squeak.html

--

Hi Karl,

> In HelpBrowser you must declare the variables before using them.
> (...)
> HelpBrowser does not implement dynamic binding of variables.

Yes - my first idea was to ask here what I needed to change in my
class TerseGuideHelp to make the "workspace" of its help browser use
dynamic biding of variables... but then I spent some hours trying to
find the answer myself, and I stumbled on a more low-level question
that I found much more askworthy...

> You can right click on a Workspace window and a HelpBrowser window
> and inspect the model and see the differences.

I did that. Are these differences obvious to a trained eye? They
weren't to me.

> Also browse class Workspace and look at access to variable
> 'bindings'.

This may be a pointer to searching tools that I need to learn. I saw
that if I click on "variables" and then on "bindings" I get a list of
the methods in Workspace that access the variable "bindings"... I also
tried to fileOut the class Workspace and to read it in Emacs, and I
found the same occurrences.

Here is an educated guess. Is the method "hasBindingOf:" the main
piece needed to make a mini-workspace support dynamic variables? If
so, how, exactly? Is there a part of the compiler that calls
"hasBindingOf:" when it sees an unknown variable? I couldn't find
it...

  Cheers,
    Eduardo Ochs



#####
#
# HelpBrowserB
# 2023mar01
#
#####

# «HelpBrowserB»  (to ".HelpBrowserB")

# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-March/223591.html Edrx 1
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-March/223594.html Edrx 2
# hb := HelpBrowserB openOn: TerseGuideHelp. hb model.  --> a HelpBrowser

Hi list,

earlier today, in this other thread,

http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223584.html

I was trying to create a subclass of HelpBrowser, called HelpBrowserB,
that would behave in a slightly modified way... to make things trivial
to test, suppose that we create it like this:

  HelpBrowser subclass: #HelpBrowserB
    instanceVariableNames: 'bindings'
    classVariableNames: 'LookupPools'
    poolDictionaries: ''
    category: 'Category-Edrx'

Then if we run this with "print it",

  hb := HelpBrowserB openOn: TerseGuideHelp.
  hb model.

the result is "a HelpBrowser", not "a HelpBrowserB".

Is that intentional or a bug?

  Thanks in advance!
    Eduardo Ochs
    http://anggtwu.net/eev-squeak.html



#####
#
# morphic-events
# 2023jan29
#
#####

# «morphic-events»  (to ".morphic-events")
# https://wiki.squeak.org/squeak/2477 Morphic Event Handling
# https://wiki.squeak.org/squeak/118 How Morphic processes events
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2003-February/date.html#start
# https://wiki.squeak.org/squeak/1500 Morph eventFilterDocumentation
# https://wiki.squeak.org/squeak/5118 MorphicEventDispatcher *
# https://wiki.squeak.org/squeak/2200 MorphicEvent
# https://wiki.squeak.org/squeak/3503 Morphic Key Events
# https://wiki.squeak.org/squeak/1256 Worlds and HandMorphs
# https://wiki.squeak.org/squeak/845 EventHandler

IconicButton new openInWorld

https://wiki.squeak.org/squeak/1253 Why Morphic is Way Cool ->
  So you want to learn more about Morphic. Do you know what a Morph
  is, where it lives, and how it relates to its environment? Do you
  know the meaning of life? Do you want to impress your friends and
  confuse your enemies? Well, this talk only covers Morphic, for the
  rest you'll have to look somewhere else.


See messageNames.
See class: Morph method: #processEvent:using:.



#####
#
# IconicButton
# 2023jan30
#
#####

# «IconicButton»  (to ".IconicButton")
# https://wiki.squeak.org/squeak/1253 Why Morphic is Way Cool
#   https://wiki.squeak.org/squeak/uploads/myiconicbutton.st
# https://wiki.squeak.org/squeak/1258 Morphic Animation
# https://wiki.squeak.org/squeak/1262 Morphic Animation II
# https://wiki.squeak.org/squeak/1264 Morphic Animation III - magic: misdirection cues
# https://wiki.squeak.org/squeak/2141 How to lay out submorphs
# https://wiki.squeak.org/squeak/59 How to lay out submorphs - example 2



#####
#
# One day this will show keyboard events in the transcript.
# 2023feb05
#
#####

# «EdrxMorph»  (to ".EdrxMorph")
# Based on:
# http://static.squeak.org/tutorials/morphic-tutorial-1.html
# https://wiki.squeak.org/squeak/1167 LearnMorphic.st
# https://wiki.squeak.org/squeak/uploads/ProgrammingMorphs.pr
# https://wiki.squeak.org/squeak/1125 Programming Morphs (Active Essay)
# https://wiki.squeak.org/squeak/1200 Programming morphs - page 1 - handles for programming
# https://wiki.squeak.org/squeak/1201 Programming morphs - page 2 - name
# https://wiki.squeak.org/squeak/1204 Programming morphs - page 3 - position, extent, color
# https://wiki.squeak.org/squeak/1205 Programming morphs - page 4 - structure
# https://wiki.squeak.org/squeak/1209 Programming morphs - page 5 - drawing
# https://wiki.squeak.org/squeak/1215 Programming morphs - page 6 - mouse events
# https://wiki.squeak.org/squeak/1216 Programming morphs - page 7 - keyboard events
# https://wiki.squeak.org/squeak/1218 Programming morphs - page 8 - animation
# https://wiki.squeak.org/squeak/1219 Programming morphs - page 9 - user queries
# https://wiki.squeak.org/squeak/2477 Morphic Event Handling
# https://wiki.squeak.org/squeak/2699 YetAnotherMorphicTutorial
# https://wiki.squeak.org/squeak/3503 Morphic Key Events
# See: http://anggtwu.net/eev-squeak.html#See

See class: Morph.
See class: Morph method: #openInWorld.
See class: Morph method: #initialize.
See class: Morph method: #drawOn:.

See class: Morph method: #eventHandler.

See class: Morph method: #handlesKeyboard:.
See class: Morph method: #keyStroke:.
See class: Morph method: #keyDown:.
See class: Morph method: #keyUp:.

See class: Morph method: #handlesMouseDown:.
See class: Morph method: #mouseEnter:.
See class: Morph method: #mouseLeave:.
See class: Morph method: #mouseDown:.
See class: Morph method: #mouseUp:.


See class: Morph.

Morph subclass: #EdrxMorph
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Category-Edrx'

EdrxMorph>>handlesMouseDown: evt
  Transcript show: evt; cr.
  ^ true

EdrxMorph>>mouseDown: evt
  self position: self position + (2 @ 0).

EdrxMorph>>handlesKeyboard: evt
  Transcript show: evt; cr.

EdrxMorph>>keyStroke: evt
  Transcript show: evt; cr.
  self position: self position + (0 @ 2).



#####
#
# KeyboardExerciser
# 2023feb08
#
#####

# «KeyboardExerciser»  (to ".KeyboardExerciser")
# https://wiki.squeak.org/squeak/2998 ObjectsTool
# World menu -> objects (o) -> Categories -> Demo -> Exercise Keyboard

See class: KeyboardExerciser.
KeyboardExerciser new openInWorld.

KeyboardExerciser>>#handlesKeyboard:
KeyboardExerciser>>#handlesMouseOver:
KeyboardExerciser>>#keyDown:
KeyboardExerciser>>#keyStroke:



#####
#
# Bricks
# 2023feb09
#
#####

# «Bricks»  (to ".Bricks")
https://wiki.squeak.org/squeak/3186 Bricks




#####
#
# Kedama
# 2023feb09
#
#####

# «Kedama»  (to ".Kedama")
# https://wiki.squeak.org/squeak/6423 Kedama2
# http://www.vpri.org/pdf/tr2005001_ohshima_kedama.pdf
# ^ Kedama: A GUI-based Interactive Massively Parallel Particle Programming System



#####
#
# game-prog-with-etoys
# 2023feb09
#
#####

# «game-prog-with-etoys»  (to ".game-prog-with-etoys")
# https://wiki.squeak.org/squeak/3913 Game programming with Etoys
# https://scg.unibe.ch/archive/papers/Gael06aC5.pdf
# https://wiki.squeak.org/squeak/uploads/Gael06aC5.pdf
# ^ Idioms for Composing Games with EToys

https://scg.unibe.ch/download/petitpetri/
https://scg.unibe.ch/download/petitpetri/petitpetri-download.zip

https://wiki.squeak.org/squeak/1773 Connectors




#####
#
# PolygonMorph
# 2023feb09
#
#####

# «PolygonMorph»  (to ".PolygonMorph")
# https://wiki.squeak.org/squeak/2190 LineMorph
# https://wiki.squeak.org/squeak/2188 PolygonMorph
# (find-squeakbyexpage (+ 16 197) "Array withAll:")
# (find-squeakbyextext (+ 16 197) "Array withAll:")

a := Array with: 50@100 with: 200@300 with: 100@400.
b := (PolygonMorph
        vertices: a color: Color red
        borderWidth: 1 borderColor: Color black).
World addMorph: b.
b beSmoothCurve.
b beStraightSegments.

b vertices.
b vertices at: 1.
b vertices at: 1 put: 40@100.
b vertices at: 1 put: 50@100.
b vertices at: 1 put: 40@100. b computeBounds.
b vertices at: 1 put: 50@100. b computeBounds.

a at: 1 put: 40@100. b computeBounds.
a at: 1 put: 50@100. b computeBounds.

b color.
b color: Color banana.
b color: Color fern.
b color: Color red.

b eventHandler: nil.
b eventHandler: [ :o | nil ].

b explore.
b eventHandler.
b explore.


See class: PolygonMorph
See class: PolygonMorph classMethod:
  #vertices:color:borderWidth:borderColor:





#####
#
# Some beginner questions about the EventHandler of a PolygonMorph
# 2023feb09
#
#####

# «PolygonMorph-EventHandler»  (to ".PolygonMorph-EventHandler")
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223407.html Edrx
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223408.html Marcel

Hi list,

I asked this question here on the list a few days ago,

http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223398.html

on how to write code that _sends_ certain keyboard events. I think
that I got a prototype of an answer for it, that "just" needs some
debugging... and then I started to work on ways to debug my prototype.

The ideal way to test sending keyboard events would be to have some
code that _receives_ and _handles_ keyboard events, and that runs
things like "Transcript show: evt" or "evt halt" when it receives a
keyboard event. I tried to adapt the code from these wiki pages

  https://wiki.squeak.org/squeak/1125 Programming Morphs (Active Essay)
  https://wiki.squeak.org/squeak/1216 Programming morphs - page 7 - keyboard events
  https://wiki.squeak.org/squeak/3503 Morphic Key Events

without much success, and I also tried to modify the keyboard
exerciser - i.e., this:

  "World menu -> objects (o) -> Categories -> Demo -> Exercise Keyboard"
  KeyboardExerciser new openInWorld.

...and then I saw a way to play with keyboard handlers that does not
require creating any classes or modifying any methods, and that can be
run entirely from a workspace with "do it"s and "print it" in the
right places. It is here:

  "The first lines were adapted from:
    https://wiki.squeak.org/squeak/2188 PolygonMorph"

  a := Array with: 50@100 with: 200@300 with: 100@400.
  b := (PolygonMorph
          vertices: a color: Color red
          borderWidth: 1 borderColor: Color black).
  World addMorph: b.
  b beSmoothCurve.
  b beStraightSegments.
  
  b vertices.
  b vertices at: 1.
  b vertices at: 1 put: 40@100.
  b vertices at: 1 put: 50@100.
  b vertices at: 1 put: 40@100. b computeBounds.
  b vertices at: 1 put: 50@100. b computeBounds.
  
  a at: 1 put: 40@100. b computeBounds.
  a at: 1 put: 50@100. b computeBounds.
  
  b color.
  b color: Color banana.
  b color: Color fern.
  b color: Color red.
  
  e := EventHandler new.
  b eventHandler.
  b eventHandler: nil.
  b eventHandler: e.

Now how do I change that event handler in interesting ways?
Does this make sense?

  e on: #keyStroke send: #halt to: b.

Also, is there a way to transfer the keyboard focus to the
PolygonMorph with a "do it" in that workspace? I guess that we
need to run the method #newKeyboardFocus:, but how exactly?
Anyone has examples to share?

# (find-squeakbyexpage (+ 16 197) "Array withAll:")
# (find-squeakbyextext (+ 16 197) "Array withAll:")




#####
#
# The EventHandler of a PolygonMorph - notes on decyphering the hints
# 2023feb18
#
#####

# «PolygonMorph-EventHandler-2»  (to ".PolygonMorph-EventHandler-2")

See cm: (HandMorph >> #processEvents).
See cm: (HandMorph >> #generateKeyboardEvent:).
See cm: (HandMorph >> #handleEvent:).
See cm: (HandMorph >> #sendKeyboardEvent:).
See cm: (HandMorph >> #sendMouseEvent:).
See cm: (HandMorph >> #newKeyboardFocus:).
See cm: (MorphicEvent >> #hand).
See cm: (HandMorph >> #sendEvent:focus:clear:).
See cm: (EventHandler >> #send:to:withEvent:fromMorph:).
See cm: (Object >> #perform:with:with:).

a := Array with: 50@100 with: 200@300 with: 100@400.
b := (PolygonMorph
        vertices: a color: Color red
        borderWidth: 1 borderColor: Color black).
World addMorph: b.

b beSmoothCurve.
b beStraightSegments.

b vertices.
b vertices at: 1.
b vertices at: 1 put: 40@100.
b vertices at: 1 put: 50@100.
b vertices at: 1 put: 40@100. b computeBounds.
b vertices at: 1 put: 50@100. b computeBounds.

b color.
b color: Color banana.
b color: Color red.

e := EventHandler new.
b eventHandler.
b eventHandler: nil.
b eventHandler: e.

bl := [ :a :b | { a . b }].
bl := [ :a :b | Transcript show: { a . b }; cr. ].
bl numArgs.
bl value: 2 value: 3.
bl perform: #value:value: with: 2 with: 3.

bl := [ :evt :sm | Transcript show: { evt . sm }; cr. ].
bl := [ :evt :sm | Transcript show: { evt keyValue . sm }; cr. ].
e on: #keyStroke send: #value:value: to: bl.
b currentHand newKeyboardFocus: b.



#####
#
# PolygonMorph-EventHandler-3
# 2023feb24
#
#####

# «PolygonMorph-EventHandler-3»  (to ".PolygonMorph-EventHandler-3")

ar := Array with: 50@100 with: 200@300 with: 100@400.
pm := (PolygonMorph
        vertices: ar color: Color red
        borderWidth: 1 borderColor: Color black).
eh := EventHandler new.
bl := [ :evt | Transcript show: evt; cr. ].
eh on: #keyStroke send: #value: to: bl.

World addMorph: pm.




#####
#
# synthetic-kb-event
# 2023feb19
#
#####

# «synthetic-kb-event»  (to ".synthetic-kb-event")
# https://mail.google.com/mail/u/0/#sent/QgrcJHrnzJZSbZlBclKHWrSBfKWBlRFksTG
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223469.html Edrx 1
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223473.html Karl 2
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223475.html Edrx 3
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223476.html Karl 4
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223478.html Karl 5
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223479.html Edrx 6

How do I create a "synthetic" keyboard event?

Hi list,

this is a follow-up to these two messages:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223407.html
http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223408.html

The first one was a question that I asked, and the second was an
answer by Marcel Taeumel. I was able to decypher almost all his
pointers - but not yet this one:

  HandMorph >> #generateKeyboardEvent:

I am using this code:

  a := Array with: 50@100 with: 200@300 with: 100@400.
  b := (PolygonMorph
          vertices: a color: Color red
          borderWidth: 1 borderColor: Color black).
  World addMorph: b.
  
  b beSmoothCurve.
  b beStraightSegments.
  
  b vertices.
  b vertices at: 1.
  b vertices at: 1 put: 40@100.
  b vertices at: 1 put: 50@100.
  b vertices at: 1 put: 40@100. b computeBounds.
  b vertices at: 1 put: 50@100. b computeBounds.
  
  b color.
  b color: Color banana.
  b color: Color red.
  
  e := EventHandler new.
  b eventHandler.
  b eventHandler: nil.
  b eventHandler: e.
  
  bl := [ :a :b | { a . b }].
  bl := [ :a :b | Transcript show: { a . b }; cr. ].
  bl numArgs.
  bl value: 2 value: 3.
  bl perform: #value:value: with: 2 with: 3.
  
  bl := [ :evt :sm | Transcript show: { evt . sm }; cr. ].
  bl := [ :evt :sm | Transcript show: { evt keyValue . sm }; cr. ].
  bl := [ :evt :sm | self halt. ].
  e on: #keyStroke send: #value:value: to: bl.
  b currentHand newKeyboardFocus: b.

It is meant to be used in a workspace. By selecting the right parts of
it and running them with "do it"s or "print it"s in the right order I
can create a PolygonMorph, some EventHandlers, and some blocks, and
then I can make the PolygonMorph react to keyboard events in different
ways. The last line switches the keyboardFocus to my PolygonMorph, and
then I can send several keystroke events to my PolygonMorph, and
inspect their events either on the transcript or on the debugger.

Question: suppose that evt is an event whose printed representation is
this one:

  [79@273 keystroke ' ' (32) 956759]

I know that this means that:

  evt position -> 79@273
  evt type -> #keystroke
  evt keyValue -> 32
  evt keyCode -> 32
  evt source -> self currentHand
  evt timeStamp -> 956759

How do I write code that creates an event like that? I would like to
create, ahem, "synthetic keystrokes", and experiment with sending them
to certain morphs...

  Thanks in advance!
    Eduardo Ochs
    http://anggtwu.net/eev-squeak.html




EventRecorderMorph new openInWorld.
See class: EventRecorderMorph.
See class: HandMorphForReplay.
See cm: (EventRecorderMorph >> #resumePlayIn:).
See cm: (WorldState >> #doOneCycleNowFor:).
See cm: (HandMorphForReplay >> #processEvents).

Once the HandMorphForReplay is set it is processed in the
WorldState>>doOneCycleNowFor:






#####
#
# EToys-kfr
# 2023feb19
#
#####

# «EToys-kfr»  (to ".EToys-kfr")
# (to "synthetic-kb-event")
# (find-squeakbyexpage (+ 16 44) "Monticello packages")
# (find-squeakbyextext (+ 16 44) "Monticello packages")
# http://source.squeak.org/inbox/EToys-kfr.493.mcz
# http://source.squeak.org/inbox/EToys-kfr.494.mcz
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223475.html

Hi Karl,

ouch, so my plan is completely wrong... it was roughly this: 1) learn
how to create synthetic keyboard events, 2) learn how to send these
events to morphs with the debugger turned on, 3) use that to find the
actions associated to typing certain keys in certain places, 4) become
less of a beginner...

I installed your two .mczs and tried this,

  EventRecordingSpace open

and I got this error after just a few keys and mouse clicks:

  MouseButtonEvent(Object)>>doesNotUnderstand: #eventType

I also took a look at the snapshot/source.st in the .mcz with Emacs
(!!!). I search for "keyboardevent" there case-insensitively, and
found very few occurrences - and none of them very enlightening...
"keystroke" has lots of occurents, but same.

Can I ask you for some suggestions and hints?

  a) How do you do my (3) above, i.e., "use that to find the actions
     associated to typing certain keys in certain places"?

  b) I've tried to learn Etoys, but many links are broken, many
     packages too, the mailing lists and forums look dead, and the
     tutorials that I could access feel very incomplete to me... for
     example, the link [1] below only has the videos 1, 10, 20, and
     30, [2] has lots of steps that took me many hours to decypher,
     and [3] shows ways to script and connect etoys that I don't have
     any idea how to do myself... when you convince people to learn
     Etoys what are the resources - including forums and mailing lists
     - that you recommend?

Thanks in advance...
  Eduardo Ochs
  http://anggtwu.net/eev-squeak.html

[1] http://www.squeakland.org/tutorials/screencasts/
[2] http://www.squeakland.org/content/articles/attach/The_Etoys_Quick_Guides.pdf
[3] https://wiki.squeak.org/squeak/3913 Game programming with Etoys




#####
#
# activeGlobals
# 2023feb18
#
#####

# «activeGlobals»  (to ".activeGlobals")
# «currentWorld»   (to ".currentWorld")
# http://wiki.squeak.org/squeak/6647 activeGlobals
# http://wiki.squeak.org/squeak/1104 ActiveWorld

self currentHand.
self currentEvent.
self currentWorld.

See cm: (Object >> #currentHand).
See cm: (Object >> #currentEvent).
See cm: (Object >> #currentWorld).
See class: ActiveHandVariable.
See class: ActiveEventVariable.
See class: ActiveWorldVariable.
See class: DynamicVariable.








  


#####
#
# morphic-tutorial-1
# 2023jan30
#
#####

# «morphic-tutorial-1»  (to ".morphic-tutorial-1")
# http://static.squeak.org/tutorials/morphic-tutorial-1.html ***

See class: Morph.
See class: Morph method: #openInWorld.
See class: Morph method: #initialize.
See class: Morph method: #drawOn:.

See class: Morph method: #eventHandler.

See class: Morph method: #handlesKeyboard:.
See class: Morph method: #keyStroke:.
See class: Morph method: #keyDown:.
See class: Morph method: #keyUp:.

See class: Morph method: #handlesMouseDown:.
See class: Morph method: #mouseEnter:.
See class: Morph method: #mouseLeave:.
See class: Morph method: #mouseDown:.
See class: Morph method: #mouseUp:.

See class: Morph method: #startStepping.
See class: Morph method: #step.
See class: Morph method: #stepTime.

See cm: (Morph >> #openInWorld).
See cm: (Morph >> #initialize).
See cm: (Morph >> #drawOn:).

See cm: (Morph >> #eventHandler).

See cm: (Morph >> #handlesKeyboard:).
See cm: (Morph >> #keyStroke:).
See cm: (Morph >> #keyDown:).
See cm: (Morph >> #keyUp:).

See cm: (Morph >> #handlesMouseDown:).
See cm: (Morph >> #mouseEnter:).
See cm: (Morph >> #mouseLeave:).
See cm: (Morph >> #mouseDown:).
See cm: (Morph >> #mouseUp:).

See cm: (Morph >> #startStepping).
See cm: (Morph >> #step).
See cm: (Morph >> #stepTime).

See class: Morph method: #handlesKeyDown.


"Define subclass:"

Morph subclass: #TestMorph
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'My Stuff'

TestMorph new openInWorld.

TestMorph>>handlesMouseDown: evt
    ^ true

TestMorph>>mouseDown: evt
    self position: self position + (10 @ 0).

TestMorph>>drawOn: aCanvas
    | colors |
    colors := Color wheel: 10.
    colors withIndexDo: [:c :i |
        aCanvas fillOval: (self bounds insetBy: self width // 25 * i + 1)
                color: c].

TestMorph>>initialize
    super initialize.
    path := OrderedCollection new.

TestMorph>>startAnimation
    path := OrderedCollection new.
    0 to: 9 do: [:i | path add: self position + (0@(10 * i))].
    path := path, path reversed.
    self startStepping.

TestMorph>>step
    path size > 0 ifTrue: [self position: path removeFirst].

TestMorph>>mouseDown: evt
    self startAnimation.

TestMorph>>stepTime
    ^ 50

TestMorph>>startAnimation
    path := OrderedCollection new.
    0 to: 29 do: [:i | path add: self position + (0@(i squared / 5.0))].
    path := path, path reversed.
    self startStepping.


First select "Object" and type the word "Morph" with a capital M. The
new class will be a subclass of Morph. Select "NameOfClass" and type
in "TestMorph". Cut out the text of the instance variable names and
the class variable names. Alt-s to accept [Command-s].

Now we can come over to the workspace and create a new instance of our
new class. Type

TestMorph new openInWorld.




#####
#
# handlesKeyboard:
# 2023jan30
#
#####

# «handlesKeyboard»  (to ".handlesKeyboard")
# https://wiki.squeak.org/squeak/2415 Morph keyboard event

MyMorph>>handlesKeyboard: evt
   ^ true

MyMorph>>mouseEnter: evt
   evt hand keyboardFocus: self.

MyMorph>>mouseLeave: evt
   evt hand releaseKeyboardFocus: self 

keyDown: anEvent
"Handle a key down event. ."
  anEvent keyCharacter = $a
     ifTrue: [self doSomething].
  anEvent keyCharacter = $q
     ifTrue: [self doAnotherOne]

See class: Morph method: #handlesKeyboard:.
See class: Morph method: #handleKeyDown:.
See class: Morph method: #keyDown.
See class: EventHandler method: #keyDown:fromMorph:.
See class: EventHandler method: #send:to:withEvent:fromMorph:.

Morph>>#keyDown:
EventHandler>>#keyDown:fromMorph:
EventHandler>>#send:to:withEvent:fromMorph:
send:to:withEvent:fromMorph:

Object>>#perform:
Object>>#perform:with:
Object>>#perform:with:with:
Object>>#perform:with:with:with:
Object>>#perform:with:with:with:with:
Object>>#perform:withArguments:
Object>>#perform:withArguments:inSuperclass:
Object>>#perform:withEnoughArguments:

perform:withArguments:




#####
#
# debugger
# 2023feb04
#
#####

# «debugger»  (to ".debugger")
# (find-books "__comp/__comp.el" "squeak-by-example")
# (find-books "__comp/__comp.el" "squeak-by-example" "6.5 The debugger")




#####
#
# My e-mail about HandMorph>>#generateKeyboardEvent:
# 2023feb03
#
#####

# «generateKeyboardEvent»  (to ".generateKeyboardEvent")
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223398.html My question
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223400.html Marcel's answer
# (find-squeakbyexpage (+ 16 242) "Keyboard events")
# (find-squeakbyextext (+ 16 242) "Keyboard events")

EventSensor>>#processKeyboardEvent:
HandMorph>>#generateKeyboardEvent:
HandMorph>>#sendKeyboardEvent:
KeyboardEvent

UserInputEventTests>>#keystroke:at:.

See class: EventSensor method: #processKeyboardEvent:.
See class: HandMorph method: #generateKeyboardEvent:.
See class: HandMorph method: #sendKeyboardEvent:.
See class: KeyboardEvent.

See class: UserInputEventTests.
See class: UserInputEventTests method: #keystroke:at:.
See class: KeyboardEvent method: #setType:buttons:position:keyValue:hand:stamp:.
See class: KeyboardEvent method: #setType:buttons:position:keyValue:keyCode:hand:stamp:.
See class: Time classMethod: millisecondClockValue.

How do I translate "sendKeyboardEvent: CR" to real code?

Hi list,

suppose that I am exploring a morph and want to use the debugger to
understand what happens when I send a CR to one of its submorphs. I
guess that a good way to do that would be to run a one-liner like this
in the explorer window,

  42 halt. (self submorphs at: 1) sendKeyboardEvent: CR.

but this is just pseudo-code, of course... I've spent some hours on
the swiki and browsing the source code of methods and classes that
looked promising, like these ones,

  EventSensor>>#processKeyboardEvent:
  HandMorph>>#generateKeyboardEvent:
  HandMorph>>#sendKeyboardEvent:
  KeyboardEvent

but I couldn't find any code that generates a keyboard event itself
and sends it to a morph... I know how to add a breakpoint to a
keyDown: method, but debugging that breakpoint would start the
debugger in a place in which a keyboard event had already been
generated, and is being processed - and I'm looking for a way to do
something that is several steps before that (break)point.

Any hints? Translations of the "sendKeyboardEvent: CR" above to real
code - either low-level or high-level - would be ideal, but links
can help me a lot too, of course...

  Thanks in advance!
  Eduardo Ochs
    http://anggtwu.net/eev-squeak.html






#####
#
# respondsTo
# 2023jan31
#
#####

# «respondsTo»  (to ".respondsTo")

See class: Behavior.
See class: Behavior method: #includesSelector:.
See class: Behavior method: #canUnderstand:.
See class: Vocabulary.
See class: Vocabulary classMethod: #instanceWhoRespondsTo:.
See class: Object.
See class: Object method: #respondsTo:



#####
#
# globals
# 2023jan31
#
#####

# «globals»  (to ".globals")
# (find-squeakbyexpage (+ 16 97) "5.7     Shared variables")
# (find-squeakbyextext (+ 16 97) "5.7     Shared variables")

Smalltalk.
Smalltalk globals.

See class: Environment.

Transcript open.
Smalltalk globals keysAndValuesDo: [:k :v |
 (v isKindOf: Trait) ifTrue: [ Transcript show: k; cr. ]
].

Smalltalk globals keysAndValuesDo: [:k :v |
 (v isMemberOf: Trait) ifTrue: [ Transcript show: k; cr. ]
].

Smalltalk globals keysAndValuesDo: [:k :v |
 (v isKindOf: TheWorldMainDockingBar) ifTrue: [ Transcript show: k; cr. ]
].

Smalltalk globals
  keysAndValuesDo: [:k :v |
    (v == TheWorldMainDockingBar) ifTrue: [ Transcript show: k; cr. ] ].

Transcript open.
Smalltalk globals keysAndValuesDo: [:k :v |
 (v isKindOf: DockingBarMorph) ifTrue: [ Transcript show: k; cr. ]
].

Smalltalk globals keysAndValuesDo: [:k :v |
 (v isKindOf: MorphicProject) ifTrue: [ Transcript show: k; cr. ]
].


Smalltalk globals
  keysAndValuesDo: [:k :v |
    (v isKindOf: MorphicProject) ifTrue: [ Transcript show: k; cr. ]
].





#####
#
# All morphs whose "world" is non-nil
# 2023jan31
#
#####

# «world-morphs»  (to ".world-morphs")
# (find-squeaksharedfile "See.st")
# (find-squeaksharedfile "See.st" "\nworldMorphs\n")
# (find-squeaksharedfile "See.st" "\nworldMorphs: ")
# (find-squeakbyexpage (+ 16 58) "select:")
# (find-squeakbyextext (+ 16 58) "select:")

See cm: (Behavior >> #allInstances).
See cm: (Behavior >> #allSubInstances).
See class: OrderedCollection.
See cm: (OrderedCollection >> #select:).

(See worldMorphs: DockingBarItemMorph) explore.
(See worldMorphs: TheWorldMainDockingBar) explore.


> Eduardo Ochs:
do you have a way to iterate through all morphs?

Morph allSubInstances class.  "-> OrderedCollection"
 Morph allSubInstances size.
(Morph allSubInstances select: [ :m | m world notNil ]) size.
(Morph allSubInstances copyFrom: 1 to: 10) class.
(Morph allSubInstances copyFrom: 1 to: 10) size.


(See worldMorphs: PluggableSystemWindow) explore.

TheWorldMainDockingBar

See worldMorphs select: [ :m | m isKindOf: PluggableSystemWindow ])

worldMorphs: class
  ^ See worldMorphs select: [ :m | m isKindOf: class ]

Morph allSubInstances select: [ :m | m world notNil ].

See worldMorphs: DockingBarItemMorph explore





#####
#
# Question about the "a" in "a TheWorldMainDockingBar"
# 2023feb01
#
#####

# «question-about-a»  (to ".question-about-a")
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223376.html My question
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223380.html Marcel's answer

Hi list,

I'm trying to port to Squeak an idea that use a lot in Emacs, that is
to use one-liners as hyperlinks. There's a page with a detailed
explanation of that idea in this link,

  http://anggtwu.net/eev-squeak.html

and here goes a short explanation, and a question.

I'm working on a class called "See", and my one-liners that work as
hyperlinks always start with "See". For example, these ones

  See class: HelpBrowser.
  See class: HelpBrowser method: #accept:.
  See class: See.
  See class: See classMethod: #item1ctsa:.
  See class: See classMethod: #class:method:.
  See class: See classMethod: #class:classMethod:.

make the SystemBrowser display different pieces of information, and
these one liners

  See fileList.
  See helpBrowser.
  See messageNames.
  See methodFinder.

are equivalent to running:

  Tools -> File List
  Apps -> Help Browser
  World -> open -> message names
  World -> open -> method finder

but there are LOTS of menu entries that I don't know how to implement
as one-liners, because their "targets" are objects that I don't know
how to access from "global code"... let me explain this.

When I run "See methodFinder" it runs this: "ECToolSet
openSelectorBrowser". I discovered that the "action" associated to
"World -> open -> method finder" is "ECToolSet openSelectorBrowser" by
using the halo to duplicate the entry "method finder" in the menu
"World -> open", and then I examined the "contents", the "target", the
"selector", and "arguments" of that first item of that menu with just
one entry. Here is a visual explanation in a screenshot,

  http://anggtwu.net/IMAGES/2023-squeak-item1ctsa.png

and in that case my function that returns the fields "contents",
"target", "selector", and "arguments" of a menu item returns this:

   {'method finder' . ECToolSet . #openSelectorBrowser . #()} 

When I try to do the same for "Help -> Squeak help" I get:

  {'Squeak Help' . a TheWorldMainDockingBar . #squeakHelp . nil}

note the "a"... =(

When I run this to try to find a global variable that holds an object
of the class TheWorldMainDockingBar,

  Smalltalk globals keysAndValuesDo: [:k :v |
   (v isKindOf: TheWorldMainDockingBar) ifTrue: [ Transcript show: k; cr. ]
  ].

it returns nothing. So I wrote these two methods in my class "See" to
help me find active morphs of a given class,

  --snip--snip--
  !See class methodsFor: 'other links' stamp: 'Edrx 2/1/2023 00:55'!
  worldMorphs
    "Return an OrderCollection with all the morphs whose world is non-nil.
     Test:
       See worldMorphs explore.
    "
    ^ Morph allSubInstances select: [ :m | m world notNil ].
  ! !

  !See class methodsFor: 'other links' stamp: 'Edrx 2/1/2023 00:57'!
  worldMorphs: class
    "Return an OrderCollection with all the morphs whose world
     is non-nil, and that are objects of the given class.
     Test:
       (See worldMorphs: DockingBarItemMorph) explore.
    "
    ^ Morph allSubInstances
          select: [ :m | (m world notNil) and: [m isKindOf: class] ]
  ! !
  --snip--snip--

but for the class TheWorldMainDockingBar this one-liner

  (See worldMorphs: TheWorldMainDockingBar) explore.

returned no instances...

Any suggestions?

  Thanks in advance,
    Eduardo Ochs
    http://anggtwu.net/eev-squeak.html
    http://anggtwu.net/SQUEAK/See.st.html
    http://anggtwu.net/SQUEAK/See.st


P.S.: I tried to send questions to the beginners mailing list, but
that list is kind of dead... so I tried to make my question a bit less
beginner-ish, and I am sending it here to squeak-dev...



#####
#
# ATheWorldMainDockingBar: storing a squeaky object in a class variable
# 2023feb01
#
#####

# «ATheWorldMainDockingBar»  (to ".ATheWorldMainDockingBar")

See class: See classMethod: #theWorldMainDockingBar
See class: See classMethod: #theWorldMainDockingBar:

See theWorldMainDockingBar: self.
See theWorldMainDockingBar.

  "Initialize the class variable ATheWorldMainDockingBar.
   This initialization needs to be done by hand. Here's how:
   go to Help -> Squeak Help; duplicate that menu
   item, debug it, and then run the expression below:

     See theWorldMainDockingBar:
       (self submorphs at: 1) target.
  "

self submorphs at: 1.
(self submorphs at: 1) target.
See theWorldMainDockingBar:
  (self submorphs at: 1) target.


See aTheWorldMainDockingBar squeakHelp.

  {'Squeak Help' . a TheWorldMainDockingBar . #squeakHelp . nil}




#####
#
# 20220302-transpose
# 2022mar03
#
#####

# «20220302-transpose»  (to ".20220302-transpose")
# (find-angg ".zshrc" "mysqueak")
# (find-mvideo "20220302squeakdemo"   "0:00")
# (find-mvideo "20220303inaworkspace" "0:00")

# (find-telegachat "1487862914#211413")
# (find-telegachat "1487862914#191060")

* (eepitch-shell3)
* (eepitch-kill)
* (eepitch-shell3)
# (find-fline "~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/")
cd             ~/SQUEAK/Squeak5.3-19459-64bit-202003021730-Linux/
./squeak.sh




#####
#
# Etoys: the "Quick Guides" (for the OLPC)
# 2023feb06
#
#####

# «etoys-qg»  (to ".etoys-qg")
# (find-angg ".emacs" "squeak")
# (find-angg ".emacs" "squeak" "etoysqg")
# (find-etoysqgpage)
# (find-etoysqgtext)
# (find-etoysqgpage 6 "Brushes")
# (find-etoysqgtext 6 "Brushes")
# (find-etoysqgpage 12 "Polygon Tool")
# (find-etoysqgtext 12 "Polygon Tool")
# (find-etoysqgpage 12 "Click Keep to close the paints" "and use scripts")
# (find-etoysqgpage 16 "Viewer of Script Tiles")
# (find-etoysqgtext 16 "Viewer of Script Tiles")
# (find-etoysqgpage 18 "Move and Pick Up")
# (find-etoysqgtext 18 "Move and Pick Up")
# (find-etoysqgpage 19 "Rotate Handle")
# (find-etoysqgtext 19 "Rotate Handle")
# (find-etoysqgpage 21 "Arrow at Center")
# (find-etoysqgtext 21 "Arrow at Center")
# (find-etoysqgpage 24 "Make a Script Tile")
# (find-etoysqgtext 24 "Make a Script Tile")
# (find-etoysqgpage 56 "Foward and Turn")
# (find-etoysqgpage 56 "Foward and Turn" "drag out a forward")
# (find-etoysqgtext 56 "Foward and Turn")
# (find-etoysqgpage 62 "Grab Me Reveal Me")
# (find-etoysqgtext 62 "Grab Me Reveal Me")

World -> new morph -> make a new drawing
Use: brush, brush size, palette, paint bucket
Use: keep
Halo -> eye/viewer
Flap -> basic -> Sketch forward by: -> !
Flap -> basic -> Sketch turn by: -> !
Sketch's x -> click on the green "<=" to detach a "Sketch script1"
Click on the arrows in Sketch's "x" to switch from "x <-" to "x increase by"
Click on number in Sketch's "x" to set it to 1
Sketch motion




#####
#
# etoys
# 2023feb02
#
#####

# «etoys»  (to ".etoys")
# (find-squeakbyexpage 14 "www.squeakland.org")
# (find-squeakbyextext 14 "www.squeakland.org")
# http://squeakland.org/
# http://www.squeakland.org/tutorials/
# http://www.squeakland.org/tutorials/demos/
# http://www.squeakland.org/tutorials/screencasts/
# http://www.squeakland.org/tutorials/screencasts/lesson01.ogg (fake url)
# http://www.squeakland.org/tutorials/screencasts/lesson10.ogg (fake url)
# http://www.squeakland.org/tutorials/screencasts/lesson20.ogg (fake url)
# http://www.squeakland.org/tutorials/screencasts/lesson30.ogg (fake url)
# http://www.squeakland.org/tutorials/courseware/
# http://www.squeakland.org/tutorials/guides/
# http://www.squeakland.org/resources/articles/
# http://www.squeakland.org/resources/articles/article.jsp?id=1001 Authoring - by Alan Kay - turned users into simple consumers
# http://www.squeakland.org/content/articles/attach/humanCondition.pdf - Galileo / lute
# http://www.squeakland.org/content/articles/attach/dynabook_revisited.pdf
# http://www.squeakland.org/content/articles/attach/etoys_n_authoring.pdf
# http://www.squeakland.org/content/articles/attach/etoys_n_learning.pdf - gravity ***
# http://www.squeakland.org/content/articles/attach/how_we_learn.pdf
# http://www.squeakland.org/content/articles/attach/sci_amer_article.pdf
# http://www.squeakland.org/resources/books/
# http://www.squeakland.org/resources/audioVisual/
# http://www.squeakland.org/content/articles/attach/The_Etoys_Quick_Guides.pdf
# http://wiki.squeakland.org/index.php?title=Main_Page
# http://wiki.squeakland.org/index.php?title=LearningWithEtoysI3
# http://wiki.squeakland.org/index.php?title=Resources
# https://wiki.squeak.org/squeak/5580 Etoys
# https://wiki.squeak.org/squeak/6522 Accessing the Smalltalk tools in Etoys
# https://wiki.squeak.org/squeak/3915 How to access Smalltalk tools in an Etoys image
# https://wiki.squeak.org/squeak/3626 Getting Started with Etoys / User Scripting
# https://wiki.squeak.org/squeak/6601 Etoys in 2018
# https://stackoverflow.com/questions/72758862/how-do-i-start-etoys-from-squeak


# https://etoysillinois.org/files/Etoys%20tutorial%201.pdf drive a car
# (code-pdf-page "etoyslab1" "$S/https/etoysillinois.org/files/Etoys%20tutorial%201.pdf")
# (code-pdf-text "etoyslab1" "$S/https/etoysillinois.org/files/Etoys%20tutorial%201.pdf")
# (find-etoyslab1page)
# (find-etoyslab1text)

World -> New morph -> Make new drawing

# (code-video "lesson01video" "$S/http/www.squeakland.org/tutorials/screencasts/lesson01.ogg")
# (code-video "lesson10video" "$S/http/www.squeakland.org/tutorials/screencasts/lesson10.ogg")
# (code-video "lesson20video" "$S/http/www.squeakland.org/tutorials/screencasts/lesson20.ogg")
# (code-video "lesson30video" "$S/http/www.squeakland.org/tutorials/screencasts/lesson30.ogg")
# (find-lesson01video "0:00")
# (find-lesson10video "0:00")
# (find-lesson20video "0:00")
# (find-lesson30video "0:00")





#####
#
# My first attempt to use Etoys to make a blob that moves like a car
# 2023feb02
#
#####

# «etoys-blob-car»  (to ".etoys-blob-car")




#####
#
# EventRecorder
# 2023feb04
#
#####

# «EventRecorder»  (to ".EventRecorder")

During recording, the EventRecorder subscribes to all events of the
normal morphic hand, and saves them as they occur.

For replay, a second playback hand is created that reads events from
the recorder and plays them back in the world.

The EventRecorder began with the work of Ted Kaehler and John Malone.
This was then signifcantly expanded by Leandro Caniglia and Valeria
Murgia as a tutorial aid for the Morphic Wrapper project.

Since that time, I have...
Changed to a simple inboard array for the tape (event storage).
Provided the ability to condense linear mouse movement with interpolation at replay.
Made simple provisions for wrap-around of the millisecond clock.
Eliminated step methods in favor of using the processEvents cycle in the playback hand.
Provided a pause/resume mechanism that is capable of surviving project changes.
Added the ability to spawn a simple 'play me' button that can be saved as a morph.
Caused the playback hand to display its cursor double size for visibility.
Integrated a voice recorder with on-the-fly compression.
	This currently does NOT survive project changes, not is its data stored on the tape.
	Right now it can only be saved by saving the entire recorder as a morph.
	This will be fixed by adding a startSound event at each project change.
	We will also convert read/write file to use saveOnFile.
Added a journal file facility for recording sequences that end in a crash.
The above two features can be engaged via the ER's morph menu.
	- Dan Ingalls 3/6/99



#####
#
# roguerrants
# 2023feb06
#
#####

# «roguerrants»  (to ".roguerrants")
# https://mail.google.com/mail/u/0/#inbox/FMfcgzGrcXjMqMWnnpWTXHvhZZXgnVCN
# http://www.zogotounga.net/comp/squeak/rogue.htm
# http://www.zogotounga.net/comp/squeak/snakes.mp4 (fake url)
# http://www.zogotounga.net/comp/saucers.htm
# http://www.zogotounga.net/comp/eindex.html
# http://www.zogotounga.net/comp/squeak/lispkit.htm
# http://www.zogotounga.net/comp/squeak/sqgeo.htm
# http://www.zogotounga.net/Bedes_etc/sommaire.html

# (code-video "snakesvideo" "$S/http/www.zogotounga.net/comp/squeak/snakes.mp4")
# (find-snakesvideo)
# (find-snakesvideo "0:00")

http://www.zogotounga.net/comp/squeak/rogue361-64.zip

# (find-man "unzip")
# (find-fline "$S/http/www.zogotounga.net/comp/squeak/rogue361-64.zip")
# (to "install-2023")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo rm -Rfv  /tmp/SQUEAK/
sudo rm -Rfv  /tmp/rogue361-64/
mkdir -p      /tmp/SQUEAK/Squeak6.0-22104/
tar -C        /tmp/SQUEAK/Squeak6.0-22104/ \
    --strip-components=1 \
    -xvzf $S/https/files.squeak.org/6.0/Squeak6.0-22104-64bit/Squeak6.0-22104-64bit-202206021410-Linux-x64.tar.gz

unzip -l       $S/http/www.zogotounga.net/comp/squeak/rogue361-64.zip
unzip -d /tmp/ $S/http/www.zogotounga.net/comp/squeak/rogue361-64.zip
cd            /tmp/rogue361-64/
mv -iv *      /tmp/SQUEAK/Squeak6.0-22104/shared/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd            /tmp/SQUEAK/Squeak6.0-22104/
./squeak.sh shared/Squeak6.0-22111-64bit+muO361+Rogue.image



# (find-fline "/tmp/SQUEAK/Squeak6.0-22104/")




#####
#
# DisplayScreen
# 2023feb09
#
#####

# «DisplayScreen»  (to ".DisplayScreen")

See class: DisplayScreen.
DisplayScreen fullScreenOn.
DisplayScreen fullScreenOff.
DisplayScreen toggleFullScreen.
DisplayScreen setNewScreenSize: 800@600.





#####
#
# LambdaMessageSend
# 2023feb06
#
#####

# «LambdaMessageSend»  (to ".LambdaMessageSend")
# http://www.zogotounga.net/comp/squeak/lispkit.htm
# http://www.zogotounga.net/comp/squeak/functionaltalk.htm



#####
#
# #launchPartVia:
# 2023feb24
#
#####

# «launchPartVia»  (to ".launchPartVia")

See cm: (Object>>#launchPartVia:).
See cm: (Object>>#launchPartVia:label:).
See cm: (StickyPadMorph class>>#launchPartVia:label:).





#####
#
# Mines
# 2023feb19
#
#####

# «Mines»  (to ".Mines")
# world -> objects -> categories -> games -> Mines

See class: Mines.
Mines launchPartVia: #newStandAlone label: 'Mynes'.



#####
#
# EventRecorder
# 2023feb19
#
#####

# «EventRecorder»  (to ".EventRecorder")
# world -> objects -> categories -> presentation -> event recorder

EventRecorderMorph launchPartVia: #newStandAlone label: 'Event Racorder'.



#####
#
# LineMorph
# 2023mar02
#
#####

# «LineMorph»  (to ".LineMorph")
# World -> new morph -> from alphabetical list -> ... Line

twm newMorphOfClass: LineMorph event: cr.





#####
#
# HorizontalNumberLineMorph
# 2023feb19
#
#####

# «HorizontalNumberLineMorph»  (to ".HorizontalNumberLineMorph")
# world -> objects -> categories -> graphing -> H number line

HorizontalNumberLineMorph launchPartVia: #newStandAlone label: 'H numba line'.




#####
#
# Slider
# 2023feb19
#
#####

# «Slider»  (to ".Slider")

I am a widget that helps users enter a numerically bounded value. I
have a minimum and a maximum value. My thumb indicates my current
value. My orientation can be vertical or horizontal, which is usually
determined by the ratio of my extent. Nevertheless, you can force me
to use a specific orientation,




#####
#
# See-store
# 2023feb19
#
#####

# «See-store»  (to ".See-store")
# (find-squeakfile "")
# (find-squeaksharedfile "")

Object subclass: #See
	instanceVariableNames: ''
	classVariableNames: 'Store'
	poolDictionaries: ''
	category: 'Category-Edrx'

!See class methodsFor: 'accessing' stamp: 'Edrx 2/19/2023 13:16'!
store
  ^ Store.
! !

!See class methodsFor: 'accessing' stamp: 'Edrx 2/19/2023 13:18'!
store: s
  Store := s.
! !

!See class methodsFor: 'accessing' stamp: 'Edrx 2/19/2023 13:19'!
at: key
  ^ Store at: key.
! !

!See class methodsFor: 'accessing' stamp: 'Edrx 2/19/2023 13:19'!
at: key put: value
  ^ Store at: key put: value.
! !




#####
#
# search-bar
# 2023feb19
#
#####

# «search-bar»  (to ".search-bar")

d := Dictionary new.
d add: #a -> 42.
d add: #b -> 33.
d.
d at: #e put: 99.

See store: Dictionary new.
See at: #sb.
sb := See at: #sb.
tm := sb textMorph.

sb explore.
sb textMorph.

See class: SearchBar.
See class: TextMorphForEditView.
See cm: (SearchBar >> #buildWith:).
See cm: (SearchBar >> #searchTerm:).
See cm: (TextMorph >> #acceptContents).
See cm: (TextMorphForEditView >> #keyStroke:)
See cm: (TextMorphForEditView>>#acceptContents).
See cm: (PluggableTextMorphPlus >> #accept).

sb := See at: #searchBar.

sb textMorph flash.
sb textMorph editView.
sb textMorph acceptContents.

sb model searchTerm.
sb model searchTerm: 'searchTerm'.
sb model accept.
sb editor accept.
sb editor acceptContents.




#####
#
# Delay
# 2023feb20
#
#####

# «Delay»  (to ".Delay")
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223483.html Edrx 1
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223484.html Vanessa 2
How do I "sleep 5"?
Hi list,

a few days ago I asked for help on how to send a "synthetic" keyboard
event to a morph, and Karl Ramberg gave me exactly the right hints in
this thread:

http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223473.html

My code is ready except for documentation and comments - I'll work on
that in the next few days and then post the result here and on the
wiki...

...but there's a feature that I want to add to it that - again =( -
needs something that I'm not being able to discover by myself. How do
I write a line of code that waits for 5 seconds, sort of like running
"sleep 5" in a shell, and that doesn't block the rest of the system?
If I have that I'll be able to run these two lines in a workspace,

  self mySleep: 5000.
  kf := self currentHand keyboardFocus.

switch the keyboard focus to something else by clicking on it, and
then the variable kf will be set to this "something else"...

Thanks in advance!
  Eduardo Ochs
  http://anggtwu.net/eev-squeak.html


See class: Delay.
See cm: (Delay >> #printOn:)
See cm: (Delay >> #beingWaitedOn:)
See cm: (Delay >> #duration:)
See cm: (Player >> #setTimer:).
See cm: (EventRecorderMorph >> #pauseIn:).
See cm: (EventRecorderMorph >> #synchronize).
See cm: (Time class >> #millisecondClockValue).

d := Delay new.
d beingWaitedOn: false.
d duration: 5000.




#####
#
# TerseGuideHelp
# 2023feb24
#
#####

# «TerseGuideHelp»  (to ".TerseGuideHelp")
# Help -> Terse Guide to Squeak -> 

See class: TerseGuideHelp.
TerseGuideHelp pages.
TerseGuideHelp pages at: 4.
TerseGuideHelp constants.
TerseGuideHelp constants title.
TerseGuideHelp constants contents.
See cm: (TerseGuideHelp class >> #constants).
See cm: (CustomHelp class >> #edit:).
TerseGuideHelp edit: #constants

See cm: (TheWorldMainDockingBar >> #terseGuideToSqueak).
See cm: (TerseGuideHelp class >> #rectangle).
See cm: (HelpBrowser class >> #openOn:).

db openHelp: #TerseGuideHelp topic: nil.

hb := HelpBrowser openOn: TerseGuideHelp.
hb explore.
hb model explore.
hb model toplevelTopics explore.
hb model toplevelTopics at: 5.

topics := hb model toplevelTopics.
topic := topics at: 5.
topic title.
topic title = 'Boolean'.
t := topics detect: [ :topic | topic title = 'Boolean' ] ifNone: [].
t.
oc := OrderedCollection new.
oc add: t.
treem selectPath: oc.

See cm: (KeyboardEvent >> #sentTo:).
See class: PluggableTreeMorph.
See cm: (PluggableTreeMorph >> #selectPath:).

hb := HelpBrowser openOn: TerseGuideHelp.
See sendEventDebug: dn to: hb.

treem := hb model dependents at: 3.
kf == treem.
See sendEvent: dn to: treem.
See sendEventDebug: dn to: treem.

dn resetHandlerFields.
treem keyStroke: dn.

treem selectPath: 42.



#####
#
# See terseGuide: topicTitle
# 2023feb25
#
#####

# «See-terseGuide»  (to ".See-terseGuide")

See cm: (See >> #terseGuide:)

"Version 1:"

terseGuide: topicTitle
  "Test:
    See terseGuide: 'Method Call'.
  "
  | hb topics tt oc treem |
  hb := HelpBrowser openOn: TerseGuideHelp.
  treem := hb model dependents at: 3.
  topics := hb model toplevelTopics.
  tt := topics detect: [ :topic | topic title = topicTitle ] ifNone: [].
  oc := OrderedCollection new.
  oc add: tt.
  treem selectPath: oc.


http://www.angelfire.com/tx4/cus/notes/smalltalk.html






#####
#
# BubbleFilters
# 2023feb25
#
#####

# «BubbleFilters»  (to ".BubbleFilters")

See cm: (Morph >> #eventBubbleFilters).
See cm: (Morph >> #sendFilterEvent:for:to:).

sendfilterevent




#####
#
# save-keystroke-events
# 2023feb24
#
#####

# «save-keystroke-events»  (to ".save-keystroke-events")
# (find-TH "eev-squeak" "key-events")

save := [ :evt | ].
bl   := [ :evt | Transcript show: evt; cr. save value: evt. ].
eh   := EventHandler new.
eh on: #keyStroke send: #value: to: bl.

rm   := RectangleMorph new.
rm openInWorld.
rm color: Color red.
rm eventHandler: eh.

save := [ :evt | cr := evt ]. See keyboardFocus: rm.
save := [ :evt | up := evt ]. See keyboardFocus: rm.
save := [ :evt | dn := evt ]. See keyboardFocus: rm.

{ cr . up . dn }

See at: #cr put: cr.
See at: #up put: up.
See at: #dn put: dn.

See run: [ sb := See keyboardFocus ] after: 5000.
sb.
See sendEvent: cr to: sb.
See sendEventDebug: cr to: sb.




#####
#
# A question on non-openInWorld-able morphs
# 2023feb25
#
#####

# «non-openInWorld-able»  (to ".non-openInWorld-able")
# (find-es "tcl" "pack-2023")
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223534.html Edrx 1
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223535.html Karl 2
# http://lists.squeakfoundation.org/pipermail/squeak-dev/2023-February/223536.html Karl 3

Hi list,

I need to ask for more pointers... =(

Now I know how to debug what happens when I send certain keys to
certains morphs. My code is here - not on the wiki yet, sorry -

  http://anggtwu.net/eev-squeak.html#key-events

and I am using that to learn how lots of things work. But the morphs
seem to fall in several different families, each one with a different
way of initializing... for morphs like these ones I can just use
openInWorld,

  sm := SimpleSwitchMorph new.
  sm openInWorld.
  bm := SimpleButtonMorph new.
  bm openInWorld.
  bm position: bm position + (0@32).
  rm := RectangleMorph new.
  rm openInWorld.
  rm position: rm position + (0@64).

but for SelectorBrowser I need to use "prototypicalToolWindow" instead
of new, and there are other ones, like SearchBar, that I don't know
how to create a new morph of that kind...

Where can I learn more about that? And where do people usually learn
how to create interfaces in which a single window displays several
subwindows and subwidgets? In Tcl/Tk this is considered basic... here
is an example of this "this": the code below

  frame   .top
  frame   .bottom
  text    .textbox -width 10 -height 5
  listbox .listbox -width 10 -height 5
  button  .button1 -text B1
  button  .button2 -text B2
  button  .button3 -text B3
  .textbox insert end "Foo\nBar"
  .listbox insert end "Item 1"
  .listbox insert end "Item 2"
  .listbox insert end "Item 3"
  pack .top     -side top
  pack .bottom  -side bottom            -fill x -expand 1
  pack .listbox -side left  -in .top
  pack .textbox -side right -in .top
  pack .button1 -side left  -in .bottom -fill x -expand 1
  pack .button2 -side left  -in .bottom -fill x -expand 1
  pack .button3 -side left  -in .bottom -fill x -expand 1

creates the window in this screenshot:

  https://i.ibb.co/ZcZGRjW/sshot.png

Thanks in advance! =)
  Eduardo Ochs
  http://anggtwu.net/eev-squeak.html




#####
#
# TestLayoutMorph
# 2023mar07
#
#####

# «TestLayoutMorph»  (to ".TestLayoutMorph")
# (to "non-openInWorld-able")

See see.

Morph subclass: #TestLayoutMorph
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Category-Edrx'

initialize
  "Test:
    TestLayoutMorph new openInWorld.
  "
  super initialize.
  self layoutPolicy: TableLayout new;
    hResizing: #shrinkWrap;
    listDirection: #center;
    wrapCentering: #center.
  self addMorphBack: (SimpleButtonMorph new label:'halt'; target: self; actionSelector: #halt).
  self addMorphBack: (SimpleButtonMorph new label:'inspect'; target: self; actionSelector: #inspect).
  self addMorphBack: (SimpleButtonMorph new label:'browse'; target: self; actionSelector: #browse).



#####
#
# LayoutPolicy
# 2023feb25
#
#####

# «LayoutPolicy»  (to ".LayoutPolicy")

See class: LayoutPolicy.
See class: TableLayout.
See cm: (Morph >> #layoutPolicy:).



#####
#
# EncoderForV3
# 2023feb27
#
#####

# «EncoderForV3»  (to ".EncoderForV3")



#####
#
# TheWorldMenu >> #newMorph
# 2023mar02
#
#####

# «TheWorldMenu-newMorph»  (to ".TheWorldMenu-newMorph")
# World -> new morph

See cm: (TheWorldMenu >> #newMorph).
See cm: (TheWorldMenu >> #menu:).
See cm: (MenuMorph >> #add:target:action:).




#####
#
# browseFullProtocol
# 2023mar03
#
#####

# «browseFullProtocol»  (to ".browseFullProtocol")
# browse protocol (p)

See cm: (See class >> #browseProtocol:).
See cm: (Browser >> #classListMenu:).
See cm: (Inspector >> #browseFullProtocol).

browseProtocol: obj
  "Refs:
    See cm: (Browser >> #classListMenu:).
    See cm: (ObjectExplorer >> #browseFullProtocol).
  "
  InstanceBrowser new openOnObject: itemLineMorph showingSelector: nil.



#####
#
# Interval
# 2023mar09
#
#####

# «Interval»  (to ".Interval")
# (find-squeakbyexpage (+ 16 200) "The class Interval")
# (find-squeakbyextext (+ 16 200) "The class Interval")

See terseGuide: #interval.
See class: Interval.
See cm: (Number >> #to:by:).

(0 to: 10 by: 2).
(0 to: 10 by: 2) collect: [ :x | x@(x*x) ].



#####
#
# Context
# 2023mar09
#
#####

# «Context»  (to ".Context")

See class: Context.
See cm: (Context >> #print:on:).
See cm: (Context >> #printDetails:).
See cm: (Context >> #printOn:).
See cm: (Context >> #printString).

See at: #ctx put: thisContext.
ctx := See at: #ctx.
ctx 
ctx at: 1.
(ctx at: 1) method.
(ctx at: 1) method methodClass.
(ctx at: 1) method searchForSelector.




#####
#
# PasteUpMorph
# 2023mar14
#
#####

# «PasteUpMorph»  (to ".PasteUpMorph")
# DisplayScreen setNewScreenSize: 1280@800






See cm: (SimpleHierarchicalListMorph >> #arrowKey:).
See cm: (SimpleHierarchicalListMorph >> #setSelectionIndex:).













sb.
sb handleEvent: evt.
sb currentHand newKeyboardFocus: sb.
sb textMorph handleEvent: evt.


ar := Array with: 50@100 with: 200@300 with: 100@400.
pm := (PolygonMorph
        vertices: ar color: Color red
        borderWidth: 1 borderColor: Color black).
eh := EventHandler new.
bl := [ :evt :sm | self halt. Transcript show: { evt . sm }; cr. ].
pm eventHandler: eh.
eh on: #keyStroke send: #value:value: to: bl.

World addMorph: pm.
See keyboardFocus: pm.

"Run this in PolygonMorph -> debugger:"
See at: #CR put: evt.
"Go back to the workspace, and then do:"

evt := See at: #CR.
evt.




bl := [ :a :b | { a . b }].
bl := [ :a :b | Transcript show: { a . b }; cr. ].
bl numArgs.
bl value: 2 value: 3.
bl perform: #value:value: with: 2 with: 3.

bl := [ :evt :sm | Transcript show: { evt . sm }; cr. ].
bl := [ :evt :sm | self halt. Transcript show: { evt . sm }; cr. ].
bl := [ :evt :sm | Transcript show: { evt keyValue . sm }; cr. ].
e on: #keyStroke send: #value:value: to: bl.
b currentHand newKeyboardFocus: b.








IRC chat, 2006aug11:

<gulik> edrx: Try this in a Squeak workspace: (1 to: 100) collect: [ :each | each * 2 ].
<gulik> Select it and press alt-i.
<gulik> Its a stupid bit of code that returns a list of numbers.
<gulik> Here's a better example that shows how inspectors update:
<gulik> Make a list:    myList := OrderedCollection new.
<gulik> Add stuff to it:          1 to: 100 do: [ :each | myList add: each ].
<gulik> select only "myList" and press alt-i.
<gulik> and then change it:       myList at: 1 put: 'hello'.
<gulik> You should see it change in the inspector.

<gulik> The debugger is pretty cool as well. Some people advocate coding using only the debugger.
<gulik> That is, write some code, run it until it fails, write more code to make it not fail and "continue" the debugger until it fails again.


Browser newOnClass: Workspace.
Workspace browse.





http://vpri.org/html/writings.htm
http://vpri.org/pdf/NSF_prop_RN-2006-002.pdf
http://piumarta.com/cv/

http://www.zogotounga.net/comp/squeak/sqgeo.htm?fbclid=IwAR0rRsbY7GYUO_ihnm0QhRmK-H4GeQZWJj9SeskOzCiMxGutqEUYYRTggUs
https://wiki.squeak.org/squeak/6007 SqueakShell as a minimal Squeak Project

# (find-squeakbyexpage (+ 16  96) "Message not understood")
# (find-squeakbyextext (+ 16  96) "Message not understood")
# (find-squeakbyexpage (+ 16 119) "SystemNavigation default browseAllCallsOn: #checkExtent:")
# (find-squeakbyextext (+ 16 119) "SystemNavigation default browseAllCallsOn: #checkExtent:")
# (find-squeakbyexpage (+ 16 121) "morphic := PackageInfo named: 'Morphic'")
# (find-squeakbyextext (+ 16 121) "morphic := PackageInfo named: 'Morphic'")
# (find-squeakbyexpage (+ 16 137) "self halt")
# (find-squeakbyextext (+ 16 137) "self halt")
# (find-squeakbyexpage (+ 16 138) "The process browser")
# (find-squeakbyextext (+ 16 138) "The process browser")
# (find-squeakbyexpage (+ 16 146) "remove doIts")
# (find-squeakbyextext (+ 16 146) "remove doIts")
# (find-squeakbyexpage (+ 16 173) "isMemberOf:")
# (find-squeakbyextext (+ 16 173) "isMemberOf:")
# (find-squeakbyexpage (+ 16 174) "isKindOf:")
# (find-squeakbyextext (+ 16 174) "isKindOf:")
# (find-squeakbyexpage (+ 16 176) "self halt")
# (find-squeakbyextext (+ 16 176) "self halt")
# (find-squeakbyexpage (+ 16 184) "Figure 8.2: The String Hierarchy")
# (find-squeakbyextext (+ 16 184) "Figure 8.2: The String Hierarchy")


See class: PluggableSystemWindow.
See class: SystemWindow.
See class: SystemWindow method: #filterEvent:for:
See class: Character.
See class: Character classMethod: #cr.
See class: HandMorph method: #generateKeyboardEvent:.
See class: PluggableTextMorphPlus.
See class: PluggablePanelMorph.
See class: TextMorphForEditView.
See cm: (Browser >> #buildDefaultBrowserWith:).
See cm: (CodeHolder >> #buildCodePaneWith:).

TheWorldMainDockingBar allInstances

https://www.taeumel.eu/ ***

http://forum.world.st/A-Sad-Day-td5120519.html
https://smalltalk.tech.blog/2020/08/10/smalltalks-successor/
https://folk.universitetetioslo.no/trygver/

http://wiki.squeak.org/squeak/3867 Tweak


http://wiki.squeak.org/squeak/784 FAQ: Breakpoints
http://wiki.squeak.org/squeak/2131 Debugger
https://stackoverflow.com/questions/5322497/how-can-i-set-a-breakpoint-in-squeak-code
http://forum.world.st/Setting-Breakpoints-to-Read-Code-td109724.html
https://vimeo.com/805242793 Stéphane Rollandin - muO: musical objects for Squeak - 25 January 2023

https://stackoverflow.com/questions/75842150/which-methods-must-i-override-to-enable-dragdrop-in-squeak





#  Local Variables:
#  coding:               utf-8-unix
#  End: