I've definitely made changes since then. My current implementation of #date: looks like this:

date: aDate

    | recompute |
    recompute := date isNil or: [date month ~= aDate month].
    date := aDate.
    recompute
        ifTrue: [self computeDays].
    self triggerEvent: #dateChanged.
    self changed: #dateChanged

So the event stuff got added after I posted that to the list.

If someone can walk me through it or point me to a page that describes how to do it, I can update the inbox with my current code.

I'm not sure why date needs to be lazy-initialized in the getter, since the instance creation methods #on: and #openOn: both set it to the date you pass in.

- Jon



On Mon, Jan 21, 2013 at 6:36 AM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Jon Hylands wrote
>     calendarMorph
>         when: #dateChanged send: #calendarDateChanged to: self

Have you made improvements since you posted the .st to this thread? Sending
when:send:to: doesn't seem to have any effect for me (i.e. the handler is
never activated). I'm attaching (to Nabble) a little class that shows the
situation...

CalendarTester.st <http://forum.world.st/file/n4664401/CalendarTester.st>



--
View this message in context: http://forum.world.st/Calendar-Chooser-tp3980015p4664401.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.