<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Ken<br>
</p>
<p>I have realized that the construction you used in the recipe <br>
</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/DrCuis/Workbench/blob/main/Morphic/How_to_create_screenshots.md">https://github.com/DrCuis/Workbench/blob/main/Morphic/How_to_create_screenshots.md</a><br>
</p>
<p>is very compact. In particular</p>
<pre class="notranslate"><code>clickArea (which is a BorderedBoxMorph object)
has a property </code><code>#'mouseButton1Up:localPosition:' which is set to a code block.
</code>
<code>
setProperty: #handlesMouseDown: toValue: true;
is necessary to activate this behavior.
If you put
mouseButton1Up:localPosition:
into a workspace, put the cursor in it and hit CMD-M.
You get a list of morphs which implement this and indeed class morph
uses this property
mouseButton1Up: aMouseButtonEvent localPosition: localEventPosition
"Handle a mouse button 1 up event.
This message will only be sent to Morphs that answer true to #handlesMouseDown:"
"Allow instances to dynamically use properties for handling common events."
self
valueOfProperty: #'mouseButton1Up:localPosition:'
ifPresentDo: [ :handler | handler value: aMouseButtonEvent value: localEventPosition ]
</code></pre>
<p></p>
<p>So the whole code is a nice example of getting instance specific
behavior.</p>
<p>I think this should be captured in a notes or remarks section in
the recipe for the cookbook.</p>
<p>Not sure how the note/remark should look exactly.<br>
</p>
<p>And when the recipe is finished we need to move it to a folder in
<br>
</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/DrCuis/How-to-guides">https://github.com/DrCuis/How-to-guides</a><br>
</p>
<p>either into an existing folder or a new one.</p>
<p>And the entry <br>
</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/DrCuis/Workbench/blob/main/Morphic/How_to_create_screenshots.md">https://github.com/DrCuis/Workbench/blob/main/Morphic/How_to_create_screenshots.md</a></p>
<p>deleted.</p>
<p>This does not need to be done immediately ; this is why there is
a workbench repository.<br>
</p>
<p>--Hannes<br>
</p>
<div class="moz-cite-prefix">On 19/05/2025 11:55 pm, H. Hirzel
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:54e3e95b-381e-47b9-82e9-6b01eeacfb57@gmail.com">Hi Ken
<br>
<br>
thank you for this useful contribution.
<br>
<br>
I have moved it to
<br>
<br>
<a class="moz-txt-link-freetext" href="https://github.com/DrCuis/Workbench/blob/main/Morphic/How_to_create_screenshots.md">https://github.com/DrCuis/Workbench/blob/main/Morphic/How_to_create_screenshots.md</a>
<br>
<br>
for the time being.
<br>
<br>
-- Hannes
<br>
<br>
On 19/05/2025 8:51 pm, ken.dickey--- via Cuis-dev wrote:
<br>
<blockquote type="cite">Useful to save screenshots while
documenting.
<br>
<br>
The attached creates a transparent Morph which, when clicked,
saves the Display view as a .png file.
<br>
<br>
Does not capture cursor.
<br>
<br>
Find code in File List, right click -> "workspace with
contents".
<br>
<br>
Change file #baseName to something useful; perhaps change
#borderWidth to zero (0).
<br>
<br>
Safe when used as directed. ;^)
<br>
<br>
HTH
<br>
-KenD
<br>
<br>
<br>
</blockquote>
</blockquote>
</body>
</html>