[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Idle Time



At 00.31 -0500 1998.10.30, Peter Hartmann wrote:
>Now the question is if and how it is possible to directly access this
>Gestalt selector via Gestalt.pm. Any sample code is greatly appreciated.


Well, the general syntax is:

  #!perl -wl
  use Mac::Gestalt qw(%Gestalt getstaltSomeConstant);
  print $Gestalt{gestaltSomeConstant()};

The constants represent four-character codes.  So installing IdleTime,
restarting, and running this:

  #!perl -wl
  use Mac::Gestalt qw(%Gestalt);
  print $Gestalt{'idle'};

Gives me some numbers that appear to be what you are looking for.

If IdleTime is ever a standard thing, one could lobby Matthias to put a
constant in Gestalt.pm for it, but this code works just fine for me, it
seems.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch