<div dir="ltr">Hi Lou,<div><br></div><div>For the Json stuff Herbert is correct.  You will need to load a Json reader.  On my image I use.  </div><div><br></div><div>Json readFrom: self readStream. To get a dictionary.  You then just read the values from the dictionary.  </div><div><br></div><div>Some other Json reader might have #readFromString: as Herbert suggested. </div><div><br></div><div>For managing the package if it is not loaded I would recommend adding </div><div><br></div><div>Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here> ]. <br></div><div><br></div><div>That way you handle the problem if the dependency is not loaded.</div><div><br></div><div>I also had a problem with my image (4.1) </div><div><br></div><div>I had to use:</div><div>Project current fullScreenOn and Project current fullScreenOff.</div><div><br></div><div>Also, it is possible to return fraction from your x point calculation which will cause problems:   I added asFloat below to fix it.</div><div><br></div><div><div>Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont: font color: color</div><div><span style="white-space:pre">   </span>"Display the string centered horizontally in the rectangle with a vertical offset from the top using the font and color."</div><div><span style="white-space:pre">   </span>| bb stringExtent f x y rOrigin |</div><div><br></div><div><span style="white-space:pre">    </span>bb := (StringMorph contents: aString font: font) imageForm boundingBox.</div><div><span style="white-space:pre">       </span>stringExtent := bb extent.</div><div><span style="white-space:pre">    </span>f := Form extent: stringExtent depth: 32.</div><div><span style="white-space:pre">     </span>f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font color: color.</div><div><span style="white-space:pre">       </span>rOrigin := rect origin.</div><div><span style="white-space:pre">       </span>x := rOrigin x + ((rect width - bb width) / 2) asFloat.</div><div><span style="white-space:pre">       </span>y := rOrigin y + vOffset.</div><div><span style="white-space:pre">     </span>self getCanvas translucentImage: f at: (x@y).</div></div><div><br></div><div>I also noticed that the time quite large :)</div><div>I'm seeing: 11:28:35.28400000001 am</div><div><br></div><div>Keep up the nice work!</div><div><br></div><div>All the best,</div><div><br>Ron</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <span dir="ltr"><<a href="mailto:Lou@keystone-software.com" target="_blank">Lou@keystone-software.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ron,<br>
<br>
Sorry, I forgot to ask, did I get the dependency stuff right?<br>
<br>
Lou<br>
<span class="im HOEnZb"><br>
On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com">ron@usmedrec.com</a>> wrote:<br>
<br>
</span><div class="HOEnZb"><div class="h5">>Hi Lou,<br>
><br>
>Very cool.<br>
><br>
>Just for fun, you can get user lat and long from the resulting dictionary<br>
>by using the following:<br>
><br>
> (WebClient httpGet: '<a href="http://freegeoip.net/json/" rel="noreferrer" target="_blank">http://freegeoip.net/json/</a>', (WebClient httpGet: '<br>
><a href="https://api.ipify.org" rel="noreferrer" target="_blank">https://api.ipify.org</a>') content) content<br>
><br>
>:)<br>
><br>
>All the best,<br>
><br>
>Ron<br>
><br>
>On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <<a href="mailto:Lou@keystone-software.com">Lou@keystone-software.com</a>><br>
>wrote:<br>
><br>
>> Hi,<br>
>><br>
>> I have created and uploaded my ClockAndCalendarMorphs project on<br>
>> SqueakSource.  It depends upon<br>
>> another of my projects, KscAstroDataApp.  KscAstroDataApp is used to<br>
>> calculate sunrise and<br>
>> sunset times displayed on the clock and calendar.  Latitude and longitude<br>
>> are required for the<br>
>> sunrise and sunset calculations.  If you don't supply them, no attempt<br>
>> will be made to do the<br>
>> calculations.  In that case the KscAstroDataApp package should not be<br>
>> needed.  Anyway it is<br>
>> probably best to download it too.<br>
>><br>
>> I'm new to SqueakSource and I'm not sure I defined the dependency<br>
>> correctly.  If not, I will<br>
>> fix it.  Please let me know if you have any problems.  The code below will<br>
>> get you started<br>
>> testing/playing with the clock morph.  The latitude & longitude are for my<br>
>> location.<br>
>><br>
>> The #initialize method of ClockImageMorph has a lot of comments about the<br>
>> options of the clock.<br>
>><br>
>> Have fun.<br>
>><br>
>> Lou<br>
>><br>
>>         | c |<br>
>> "       c := ClockImageMorph clockFace: 'path2picture.jpg'."<br>
>>         c := ClockImageMorph new.<br>
>> "       c setTestMode."<br>
>>         c desiredExtent: 1200@800.<br>
>>         c setIncludeCalendar.<br>
>>         c latitude: 40.66296 longitude: -74.535398.<br>
>> "       c beTwentyFourHourClock."<br>
>>         c setUseArabicNumerals.<br>
>> "       c setUseRomanNumerals."<br>
>>         c setAddCirclesAndTicks.<br>
>> "       c setUseFancyHourHand.<br>
>>         c setUseFancyMinuteHand.<br>
>>         c setUseFancySecondHand."<br>
>> "       c beFullScreen."<br>
>>         c setShowDateTimeInfo.<br>
>>         c numberColor: Color blue; circleColor: Color blue; tickColor:<br>
>> Color blue.<br>
>>         c hourHandColor: Color blue; minuteHandColor: Color blue;<br>
>> secondHandColor: Color blue.<br>
>>         c calendarTextColor: Color blue.<br>
>>         c open.<br>
>> --<br>
>> Louis LaBrunda<br>
>> Keystone Software Corp.<br>
>> SkypeMe callto://PhotonDemon<br>
>><br>
>><br>
>><br>
--<br>
Louis LaBrunda<br>
Keystone Software Corp.<br>
SkypeMe callto://PhotonDemon<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>