[squeak-dev] ClockAndCalendarMorphs project on SqueakSource

David T. Lewis lewis at mail.msen.com
Thu Feb 1 03:38:50 UTC 2018


On Wed, Jan 31, 2018 at 04:42:21PM -0500, Louis LaBrunda wrote:
> Hi Ron and Everyone,
> 
> Thank you all for your comments and help.  It seems there is a project name size limitation
> that I didn't notice when I first created the project.  So I removed the project named
> "ClockAndCalendarMorp" and created a new one called "ClockCalendarMorphs".  The old project is
> still listed and I'm not sure how to get rid of it?
> 

Hi Lou,

I have admin access to squeaksource.com, so I think that I can delete the
"ClockAndCalendarMorp" one if you would like me to do so. You may be able to
do it yourself too (one would hope, given that it is your project! ). Check
and see if you have a "Delete Project" option under the "Actions" in the upper
left of the screen when you enter the project. If that is not possible let me
know and I will get rid of it for you.

> I made a few changes.  The latest version is ClockAndCalendarMorphs-LL.3.mcz.

Just for the sake of maintaining the version history, it would be good if you
can put a copy of your original ClockAndCalendarMorphs-LL.2.mcz into the new
repository also. I can help if you do not have an easy way to do that.

Dave

> 
> I fixed a bug or two that Ron pointed out, thanks Ron.  If latitude or longitude are not
> supplied I try to use Ron's web access to get them.  I used the JSON package Tim said he uses
> (I found it before I saw his post, so I got lucky).  I wrapped that code to trap and ignore
> errors.  I changed the calendar header where the date/time/sunrise/sunset info is displayed.
> It's a little taller, shows seconds on sunrise and sunset (not really needed but why not) and
> uses 24 hour or AM/PM.  I made the simple clock handles a little easier to tell apart.
> 
> I didn't add any dependencies as I'm still confused as to how that works.  
> 
> Lou
> 
> On Wed, 31 Jan 2018 12:11:33 -0500, Ron Teitelbaum <ron at usmedrec.com> wrote:
> 
> >Hi Lou,
> >
> >One more thing: http://www.squeaksource.com/ClockAndCalendarMorp
> >
> >Not sure if there was a name size limitation but I would change that to
> >Morph instead of Morp.
> >
> >All the best,
> >
> >Ron
> >
> >On Wed, Jan 31, 2018 at 11:34 AM, Ron Teitelbaum <ron at usmedrec.com> wrote:
> >
> >> Hi Lou,
> >>
> >> For the Json stuff Herbert is correct.  You will need to load a
> >> Json reader.  On my image I use.
> >>
> >> Json readFrom: self readStream. To get a dictionary.  You then just read
> >> the values from the dictionary.
> >>
> >> Some other Json reader might have #readFromString: as Herbert suggested.
> >>
> >> For managing the package if it is not loaded I would recommend adding
> >>
> >> Smalltalk at: #KscEarthSunAstroData ifPresent: [ <put your draw code here>
> >> ].
> >>
> >> That way you handle the problem if the dependency is not loaded.
> >>
> >> I also had a problem with my image (4.1)
> >>
> >> I had to use:
> >> Project current fullScreenOn and Project current fullScreenOff.
> >>
> >> Also, it is possible to return fraction from your x point calculation
> >> which will cause problems:   I added asFloat below to fix it.
> >>
> >> Form >> drawString: aString centeredIn: rect vOffset: vOffset withFont:
> >> font color: color
> >> "Display the string centered horizontally in the rectangle with a vertical
> >> offset from the top using the font and color."
> >> | bb stringExtent f x y rOrigin |
> >>
> >> bb := (StringMorph contents: aString font: font) imageForm boundingBox.
> >> stringExtent := bb extent.
> >> f := Form extent: stringExtent depth: 32.
> >> f getCanvas drawString: aString in: (0 at 0 extent: stringExtent) font: font
> >> color: color.
> >> rOrigin := rect origin.
> >> x := rOrigin x + ((rect width - bb width) / 2) asFloat.
> >> y := rOrigin y + vOffset.
> >> self getCanvas translucentImage: f at: (x at y).
> >>
> >> I also noticed that the time quite large :)
> >> I'm seeing: 11:28:35.28400000001 am
> >>
> >> Keep up the nice work!
> >>
> >> All the best,
> >>
> >> Ron
> >>
> >>
> >> On Tue, Jan 30, 2018 at 7:43 PM, Louis LaBrunda <Lou at keystone-software.com
> >> > wrote:
> >>
> >>> Hi Ron,
> >>>
> >>> Sorry, I forgot to ask, did I get the dependency stuff right?
> >>>
> >>> Lou
> >>>
> >>> On Tue, 30 Jan 2018 15:04:24 -0500, Ron Teitelbaum <ron at usmedrec.com>
> >>> wrote:
> >>>
> >>> >Hi Lou,
> >>> >
> >>> >Very cool.
> >>> >
> >>> >Just for fun, you can get user lat and long from the resulting dictionary
> >>> >by using the following:
> >>> >
> >>> > (WebClient httpGet: 'http://freegeoip.net/json/', (WebClient httpGet: '
> >>> >https://api.ipify.org') content) content
> >>> >
> >>> >:)
> >>> >
> >>> >All the best,
> >>> >
> >>> >Ron
> >>> >
> >>> >On Tue, Jan 30, 2018 at 2:40 PM, Louis LaBrunda <
> >>> Lou at keystone-software.com>
> >>> >wrote:
> >>> >
> >>> >> Hi,
> >>> >>
> >>> >> I have created and uploaded my ClockAndCalendarMorphs project on
> >>> >> SqueakSource.  It depends upon
> >>> >> another of my projects, KscAstroDataApp.  KscAstroDataApp is used to
> >>> >> calculate sunrise and
> >>> >> sunset times displayed on the clock and calendar.  Latitude and
> >>> longitude
> >>> >> are required for the
> >>> >> sunrise and sunset calculations.  If you don't supply them, no attempt
> >>> >> will be made to do the
> >>> >> calculations.  In that case the KscAstroDataApp package should not be
> >>> >> needed.  Anyway it is
> >>> >> probably best to download it too.
> >>> >>
> >>> >> I'm new to SqueakSource and I'm not sure I defined the dependency
> >>> >> correctly.  If not, I will
> >>> >> fix it.  Please let me know if you have any problems.  The code below
> >>> will
> >>> >> get you started
> >>> >> testing/playing with the clock morph.  The latitude & longitude are
> >>> for my
> >>> >> location.
> >>> >>
> >>> >> The #initialize method of ClockImageMorph has a lot of comments about
> >>> the
> >>> >> options of the clock.
> >>> >>
> >>> >> Have fun.
> >>> >>
> >>> >> Lou
> >>> >>
> >>> >>         | c |
> >>> >> "       c := ClockImageMorph clockFace: 'path2picture.jpg'."
> >>> >>         c := ClockImageMorph new.
> >>> >> "       c setTestMode."
> >>> >>         c desiredExtent: 1200 at 800.
> >>> >>         c setIncludeCalendar.
> >>> >>         c latitude: 40.66296 longitude: -74.535398.
> >>> >> "       c beTwentyFourHourClock."
> >>> >>         c setUseArabicNumerals.
> >>> >> "       c setUseRomanNumerals."
> >>> >>         c setAddCirclesAndTicks.
> >>> >> "       c setUseFancyHourHand.
> >>> >>         c setUseFancyMinuteHand.
> >>> >>         c setUseFancySecondHand."
> >>> >> "       c beFullScreen."
> >>> >>         c setShowDateTimeInfo.
> >>> >>         c numberColor: Color blue; circleColor: Color blue; tickColor:
> >>> >> Color blue.
> >>> >>         c hourHandColor: Color blue; minuteHandColor: Color blue;
> >>> >> secondHandColor: Color blue.
> >>> >>         c calendarTextColor: Color blue.
> >>> >>         c open.
> >>> >> --
> >>> >> Louis LaBrunda
> >>> >> Keystone Software Corp.
> >>> >> SkypeMe callto://PhotonDemon
> >>> >>
> >>> >>
> >>> >>
> >>> --
> >>> Louis LaBrunda
> >>> Keystone Software Corp.
> >>> SkypeMe callto://PhotonDemon
> >>>
> >>>
> >>>
> >>
> -- 
> Louis LaBrunda
> Keystone Software Corp.
> SkypeMe callto://PhotonDemon
> 
> 


More information about the Squeak-dev mailing list