Hi Folks:
A quick question about OS events and Squeak...I'm in the process of hacking up a PDA application for the iPaq running Squeak. I'm doing this on Linux for the iPaq as well.
Anyway, I'm trying to figure out how best to impliment an alarm for a calendar similar to what the Palm does. I want to be able to set events for dates & times and have the iPaq wake up and make a 'beep' or something. The functionality for the alarm wakeup stuff is all OS-level, and is not quite there yet...however it probably will be in short order.
So my question is, how best to read an OS event like this from Squeak? I'm thinking that OSProcess might be my best bet, but that would limit portability. I'm not sure exactly how the 'wakeup event' will appear... probably an APM related event, I imagine.
Any ideas?
(and for anyone interested, the latest release of Linux for the iPaq is quite nice...it includes 'ipkg', similar to Debian's dpkg which makes it trivial to strip the system down to it's bare bones for space. All that, and the power/suspend button finally works. :)
On Mon, May 28, 2001 at 08:30:48AM -0400, Kevin Fisher wrote:
So my question is, how best to read an OS event like this from Squeak? I'm thinking that OSProcess might be my best bet, but that would limit portability. I'm not sure exactly how the 'wakeup event' will appear... probably an APM related event, I imagine.
Any ideas?
Assuming Linux underneath, a quick and dirty hack with OSProcess would be something like this: [(ConnectedUnixProcess command: 'sleep 5; echo I just slept 5 seconds') output inspect] fork
For an example of catching an OS signal and signaling a Smalltalk semaphore see UnixOSProcessPlugin>>reapChildProcess. This mechanism provides a callback triggered by an OS signal, and you could use something like that to catch (for example) SIGUSR1 as an event trigger, possibly scheduling the wakeup with a program run from /usr/bin/at.
OSProcess does not provide any generalized external event handling. The right way to do it is with something like Lex Spoon posted on http://www.cc.gatech.edu/~lex/squeak/ (see the sqaio.c and sqaio.h files at the end of the page). This will enable a more general treatment of "file events" and "socket events" similar to the way Tk/Tcl does it. Hopefully something like this will be on the way as part of Ian's source distribution.
- Dave
squeak-dev@lists.squeakfoundation.org