<div dir="ltr">Hi Lou,<div><br></div><div>Well since you are really trying to add backward compatibility why not make it explicit.</div><div><br></div><div>Not sure when it was deprecated assuming it was 4.1</div><div><br></div><div>"Provide backward compatibility for deprecated method #fullScreenOn which was moved to DisplayScreen in Squeak 4.1"</div><div>versionArray := Smalltalk version splitInteger.<br></div><div>(versionArray first = 'Squeak' and: [versionArray second <= 4.1]) ifTrue: [  </div><div>   Project current fullScreenOn] </div><div>ifFalse: [</div><div>   DisplayScreen fullScreenOn].</div><div><br></div><div>I didn't actually run this code so YMMV :).</div><div><br></div><div>Oh and since you need this twice you should add the results of the test to a variable so you don't have to call it twice for #fullScreenOff. </div><div><br></div><div>All the best,</div><div><br></div><div>Ron</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 1, 2018 at 11:44 AM, 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 about your DisplayScreen fullScreenOn problem.  It seems #fullScreenOn is<br>
deprecated in Project.  So, using DisplayScreen fullScreenOn seems correct going forward.  What<br>
do you think of this:<br>
<br>
        [DisplayScreen fullScreenOn] on: Error do: [:e | Project current fullScreenOn].<br>
<br>
Lou<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com">ron@usmedrec.com</a>> wrote:<br>
<br>
>Hi Lou,<br>
><br>
>One more thing: <a href="http://www.squeaksource.com/ClockAndCalendarMorp" rel="noreferrer" target="_blank">http://www.squeaksource.com/<wbr>ClockAndCalendarMorp</a><br>
><br>
>Not sure if there was a name size limitation but I would change that to<br>
>Morph instead of Morp.<br>
><br>
>All the best,<br>
><br>
>Ron<br>
><br>
>On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com">ron@usmedrec.com</a>> wrote:<br>
><br>
>> Hi Lou,<br>
>><br>
>> For the Json stuff Herbert is correct.  You will need to load a<br>
>> Json reader.  On my image I use.<br>
>><br>
>> Json readFrom: self readStream. To get a dictionary.  You then just read<br>
>> the values from the dictionary.<br>
>><br>
>> Some other Json reader might have #readFromString: as Herbert suggested.<br>
>><br>
>> For managing the package if it is not loaded I would recommend adding<br>
>><br>
>> Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here><br>
>> ].<br>
>><br>
>> That way you handle the problem if the dependency is not loaded.<br>
>><br>
>> I also had a problem with my image (4.1)<br>
>><br>
>> I had to use:<br>
>> Project current fullScreenOn and Project current fullScreenOff.<br>
>><br>
>> Also, it is possible to return fraction from your x point calculation<br>
>> which will cause problems:   I added asFloat below to fix it.<br>
>><br>
>> Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont:<br>
>> font color: color<br>
>> "Display the string centered horizontally in the rectangle with a vertical<br>
>> offset from the top using the font and color."<br>
>> | bb stringExtent f x y rOrigin |<br>
>><br>
>> bb := (StringMorph contents: aString font: font) imageForm boundingBox.<br>
>> stringExtent := bb extent.<br>
>> f := Form extent: stringExtent depth: 32.<br>
>> f getCanvas drawString: aString in: (0@0 extent: stringExtent) font: font<br>
>> color: color.<br>
>> rOrigin := rect origin.<br>
>> x := rOrigin x + ((rect width - bb width) / 2) asFloat.<br>
>> y := rOrigin y + vOffset.<br>
>> self getCanvas translucentImage: f at: (x@y).<br>
>><br>
>> I also noticed that the time quite large :)<br>
>> I'm seeing: 11:28:35.28400000001 am<br>
>><br>
>> Keep up the nice work!<br>
>><br>
>> All the best,<br>
>><br>
>> Ron<br>
>><br>
>><br>
>> On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <<a href="mailto:Lou@keystone-software.com">Lou@keystone-software.com</a><br>
>> > wrote:<br>
>><br>
>>> Hi Ron,<br>
>>><br>
>>> Sorry, I forgot to ask, did I get the dependency stuff right?<br>
>>><br>
>>> Lou<br>
>>><br>
>>> On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum <<a href="mailto:ron@usmedrec.com">ron@usmedrec.com</a>><br>
>>> wrote:<br>
>>><br>
>>> >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 <<br>
>>> <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<br>
>>> 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<br>
>>> will<br>
>>> >> get you started<br>
>>> >> testing/playing with the clock morph.  The latitude & longitude are<br>
>>> for my<br>
>>> >> location.<br>
>>> >><br>
>>> >> The #initialize method of ClockImageMorph has a lot of comments about<br>
>>> 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>
>>><br>
>><br>
--<br>
Louis LaBrunda<br>
Keystone Software Corp.<br>
SkypeMe callto://PhotonDemon<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>