<div dir="ltr">Thanks so much for this detail!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 25, 2024 at 2:32 PM <<a href="mailto:ken.dickey@whidbey.com">ken.dickey@whidbey.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Mark,<br>
<br>
This is an advanced usage, but I thought to mention it because you will <br>
sometimes load a package which references undefined classes.<br>
<br>
E.g. when you `Feature require: 'UI-MetaProperties'.` you will see <br>
Transcript entries like the following.<br>
<br>
vvv===vvv<br>
Package UI-DragAndDrop successfully installed<br>
Undeclared: a Dictionary(#MetaProperty->nil <br>
#MetaPropertyMultiSelect->nil)<br>
^^^===^^^<br>
<br>
This is a case of "forward reference" where one needs to break circular <br>
Package dependencies.<br>
<br>
In these cases, you should see some "guard code" as in the following.<br>
<br>
VVV===VVV==<a href="http://UI-DragAndDrop.pck.st" rel="noreferrer" target="_blank">UI-DragAndDrop.pck.st</a>==V<br>
!FontMorph methodsFor: 'dropping/grabbing' stamp: 'KenD 2/9/2022 <br>
06:50:39'!<br>
dropAction: aDropTargetMorph<br>
"Find accepting MetaProperties of target morph<br>
and allow user to choose action."<br>
<br>
| metaPropsForMyValue myValue choices selection |<br>
(Smalltalk includesKey: #MetaProperty) ifFalse: [^nil ].<br>
<br>
myValue := self valueWhenDropped.<br>
metaPropsForMyValue :=<br>
(MetaProperty metaPropsForMorph:<br>
aDropTargetMorph targetMorph)<br>
select: [ :metaProp | metaProp accepts: myValue ].<br>
(metaPropsForMyValue size isZero) ifTrue: [^nil ].<br>
<br>
choices := OrderedCollection with: #Cancel.<br>
choices addAll: (metaPropsForMyValue keys).<br>
<br>
"I am being carried by the hand. Disappear and let user make a <br>
choice."<br>
self delete.<br>
selection := PopUpMenu withCaption: 'Choose setter'<br>
chooseFrom: choices.<br>
(selection = 1) ifFalse: [ "1 -> Cancel" | propName setterSym |<br>
propName := choices at: selection.<br>
setterSym := (propName , ':') asSymbol.<br>
aDropTargetMorph targetMorph<br>
perform: setterSym<br>
with: myValue ;<br>
triggerEvent: #propertyChanged.<br>
].! !<br>
^^^===^^^<br>
<br>
In this case DragAndDrop code uses MetaProperties only if they are <br>
loaded.<br>
[NB: UI-MetaProperties requires UI-DragAndDrop].<br>
<br>
So expect to see something like<br>
(Smalltalk includesKey: #MetaProperty) ifFalse: [ ^nil ]. "guard"<br>
<br>
If you see a dependency which is not handled this way, it is a sign that <br>
someone forget to add a Feature/Package dependency to the package you <br>
are loading. Easy to being up the Installed Packages browser and add, <br>
then recheck.<br>
<br>
Perhaps a mention if/when you describe making a package. Note:<br>
<br>
<a href="https://github.com/Cuis-Smalltalk/Learning-Cuis/blob/master/SamplePackage1.md" rel="noreferrer" target="_blank">https://github.com/Cuis-Smalltalk/Learning-Cuis/blob/master/SamplePackage1.md</a><br>
<br>
Cheers,<br>
-KenD<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>