New widget: Tk::LockDisplay 
Author Message
 New widget: Tk::LockDisplay

If anyone cares, or has comments, from the README:

Tk::LockDisplay is a Perl/Tk widget that disables an X display until a
proper authentication string is entered (typically the user's
passwd). The authentication subroutine is specified during widget
creation.  People often lock their display for short periods of time
when, for instance, they need to use the rest room.  It's needed around
here because folks use xlock which doesn't do AFS authentication, so
they're "inconvenienced".

While the display is locked, a simple "screen saver" is displayed in
case someone needs to waste time.  Tk::LockDisplay "wakes up" with a
key press or mouse motion, and goes away when authentication is
completed.

After some number of (user configurable) seconds of inactivity, 10 by
default, the password entry widget and logo are hidden so all that
remains is the colorful screen saver display.  The "velocity" of the
moving screen saver pattern is also user configurable.

Tk::LockDisplay ships with a few screen savers, but has a hook to
register your own Perl/Tk subroutine.

You can test drive the widget from CPAN, under:

.../authors/id/LUSOL/Tk-LockDisplay-1.0.tar.gz

An observation:  overrideredirect(1) has some interesting side effects
which depend on your window manager.  The kicker is sometimes focus()
doesn't work, so you can't unlock your display.  Fortunately, I have
debug turned on so a <Double-1> event let's one escape.  I discovered
that focusForce() works for these WMs, so here's the patch:

*** LockDisplay.pm      Mon Sep 14 11:04:01 1998
--- /usr/local/lib/perl5/site_perl/5.005/Tk/LockDisplay.pm      Mon Sep 14 11:32:27 1998
***************
*** 30,36 ****
      $self->{e}->delete(0 => 'end');
      my $old_focus = $self->focusSave;
      my $old_grab  = $self->grabSave;
!     $self->{e}->focus;
      $self->grab(-global);
      $self->raise;
      $self->waitVariable(\$self->{unlock});
--- 30,36 ----
      $self->{e}->delete(0 => 'end');
      my $old_focus = $self->focusSave;
      my $old_grab  = $self->grabSave;
!     $self->{e}->focusForce;
      $self->grab(-global);
      $self->raise;
      $self->waitVariable(\$self->{unlock});
==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Fri, 02 Mar 2001 03:00:00 GMT  
 New widget: Tk::LockDisplay

Quote:

> While the display is locked, a simple "screen saver" is displayed in
> case someone needs to waste time.  Tk::LockDisplay "wakes up" with a
> key press or mouse motion, and goes away when authentication is
> completed.

Is it possible to NOT have a screen saver run.  I'd like to lock the
display for keyboard and mouse input but leave what's on the screen
showing?

TIA,
Rod
--
Roderick A. Anderson

Voice: 208.765.6149                            212 S. 11th Street, Suite 5
FAX: 208.664.5299                                  Coeur d'Alene, ID 83814
           Please don't tell my mother I'm a System Administrator.
                   She thinks I play piano in a bordello.

==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Fri, 02 Mar 2001 03:00:00 GMT  
 New widget: Tk::LockDisplay

Quote:


> > While the display is locked, a simple "screen saver" is displayed in
> > case someone needs to waste time.  Tk::LockDisplay "wakes up" with a
> > key press or mouse motion, and goes away when authentication is
> > completed.

> Is it possible to NOT have a screen saver run.  I'd like to lock the
> display for keyboard and mouse input but leave what's on the screen
> showing?

Hmm.... I'll have to think how to do that, but I'll add the feature assuming
there's a way...
==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Fri, 02 Mar 2001 03:00:00 GMT  
 New widget: Tk::LockDisplay

Jooh, so next TPJ will have an interesting Tk article?  :-)

 > If anyone cares, or has comments, from the README:

2 cents:

        o Tk::LockDisplay has no $VERSION defined so CPAN.pm 'r' command
          can not do it's job.

        o play save: use base should have Tk::Derived as first element

        o Use a '=for category' that is already used by Tk distribution
          if possible.  So a Tk module index page has not to many sub-
          groups.

        o Tk::LockDisplay requires 5.005. Is this necessary? If yes I
          would suggest to add this to README and add a use 5.005 to
          Makefile.PL.

        o better name for -velocity.  Currently smaller values means
          faster was is not optimal.

        o Wouldn't -animationcmd be a better name than -mesmerize
          Adding a some sort of animation extension mechanism would be
          a plus. E.g.,

                -animation => 'my_favorite'

          would try to invoke

                &Tk::LockDisplay::my_favorite::Amination($canvas)

          If somebody is in the mud: generalize the 'Bouncing
          Ball' demo to the useable as for the screen saver and
          'lines' as a canvas demo.

        o A negative velocity setting could be used to disable
          animation.  Maybe a dummy animation mode 'none' is
          a better solution?

        o Make tklock (also) work with more wide spread passwd/NIS,
          not only esoteric AFS :-)

          Are you planning exhancements for tklock script?  Should
          tklock get an entry in the Scripts section of the 'Tk
          module list'?

Here the 'Tk Module List' entry Stephen suggested:

Name           DSLI  Description                                   Info
-------------  ----  --------------------------------------------  -----
LockDisplay    RdpO  Create screen saver, wait password response   LUSOL

Isn't 'Create' dispensable?  How about?

                     Screen saver widget + opt. password response
or
                     Screen saver/lock widget with opt. animation

Comments?

Achim
P.S.
Site note about POD:  While perfectly legal to split POD into it's
own file like you did:

        LockDisplay.pm
        LockDisplay.pod

Tk will neither 'prefer' nor 'discourage' this style.
That all POD docs in the base Tk distribution are currently in their own
files under pod/ was just done to make 'global' substitutions easier.
So mix pod with code or add pod after __END__ or put pod into it's
own file just as you like.

 >
 > Tk::LockDisplay is a Perl/Tk widget that disables an X display until a
 > proper authentication string is entered (typically the user's
 > passwd). The authentication subroutine is specified during widget
 > creation.  People often lock their display for short periods of time
 > when, for instance, they need to use the rest room.  It's needed around
 > here because folks use xlock which doesn't do AFS authentication, so
 > they're "inconvenienced".
 >
 > While the display is locked, a simple "screen saver" is displayed in
 > case someone needs to waste time.  Tk::LockDisplay "wakes up" with a
 > key press or mouse motion, and goes away when authentication is
 > completed.
 >
 > After some number of (user configurable) seconds of inactivity, 10 by
 > default, the password entry widget and logo are hidden so all that
 > remains is the colorful screen saver display.  The "velocity" of the
 > moving screen saver pattern is also user configurable.
 >
 > Tk::LockDisplay ships with a few screen savers, but has a hook to
 > register your own Perl/Tk subroutine.
 >
 >
 > You can test drive the widget from CPAN, under:
 >
 > .../authors/id/LUSOL/Tk-LockDisplay-1.0.tar.gz
 >
 >
 > An observation:  overrideredirect(1) has some interesting side effects
 > which depend on your window manager.  The kicker is sometimes focus()
 > doesn't work, so you can't unlock your display.  Fortunately, I have
 > debug turned on so a <Double-1> event let's one escape.  I discovered
 > that focusForce() works for these WMs, so here's the patch:
 >
 > *** LockDisplay.pm      Mon Sep 14 11:04:01 1998
 > --- /usr/local/lib/perl5/site_perl/5.005/Tk/LockDisplay.pm      Mon Sep 14 11:32:27 1998
 > ***************
 > *** 30,36 ****
 >       $self->{e}->delete(0 => 'end');
 >       my $old_focus = $self->focusSave;
 >       my $old_grab  = $self->grabSave;
 > !     $self->{e}->focus;
 >       $self->grab(-global);
 >       $self->raise;
 >       $self->waitVariable(\$self->{unlock});
 > --- 30,36 ----
 >       $self->{e}->delete(0 => 'end');
 >       my $old_focus = $self->focusSave;
 >       my $old_grab  = $self->grabSave;
 > !     $self->{e}->focusForce;
 >       $self->grab(-global);
 >       $self->raise;
 >       $self->waitVariable(\$self->{unlock});
==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Fri, 02 Mar 2001 03:00:00 GMT  
 New widget: Tk::LockDisplay

Quote:

> Jooh, so next TPJ will have an interesting Tk article?  :-)

The thought occurred to me, now that you've put me on the spot!
I'd like to do one more for the year.... was planning a Win32
article.  Any ideas out there?

Quote:


>  > If anyone cares, or has comments, from the README:

> 2 cents:

OK, I learned my lesson:  the reason we all should post widgets here
is for community feedback (-:

Quote:

>         o Tk::LockDisplay has no $VERSION defined so CPAN.pm 'r' command
>           can not do it's job.

Good catch.  Got confused with Win 32 PPM who doesn't use version from the .PM
file but rather the Makefile.PL.  I used to do VERSION_FROM and point to the
source file so I didn't have to keep version data in more than one location.
So now I need version in source code and Makefile...

Quote:

>         o play save: use base should have Tk::Derived as first element

OK.

Quote:

>         o Use a '=for category' that is already used by Tk distribution
>           if possible.  So a Tk module index page has not to many sub-
>           groups.

OK, that's news to me, thanks.

Quote:

>         o Tk::LockDisplay requires 5.005. Is this necessary? If yes I
>           would suggest to add this to README and add a use 5.005 to
>           Makefile.PL.

I'll pull the *one* (I think) 5.005 statement so it works with 5.004.

Quote:

>         o better name for -velocity.  Currently smaller values means
>           faster was is not optimal.

Lazyness got the best of me.  Once velocity's definition changed, well...

Quote:

>         o Wouldn't -animationcmd be a better name than -mesmerize
>           Adding a some sort of animation extension mechanism would be

The name could use changing, for sure.

Quote:
>           a plus. E.g.,

>                 -animation => 'my_favorite'

>           would try to invoke

>                 &Tk::LockDisplay::my_favorite::Amination($canvas)

I already allow -animation => sub {}, is that good enough?

Quote:

>           If somebody is in the mud: generalize the 'Bouncing
>           Ball' demo to the useable as for the screen saver and
>           'lines' as a canvas demo.

On my list, way at the bottom.

Quote:

>         o A negative velocity setting could be used to disable
>           animation.  Maybe a dummy animation mode 'none' is
>           a better solution?

Similar to Roderick's request..... must grok how to do this.

Quote:

>         o Make tklock (also) work with more wide spread passwd/NIS,
>           not only esoteric AFS :-)

Tk::LockDisplay was to be the only "deliverable" - tklock was mine...
we'll see (-:

Quote:

>           Are you planning exhancements for tklock script?  Should
>           tklock get an entry in the Scripts section of the 'Tk
>           module list'?

As above, we'll see...

Quote:

> Here the 'Tk Module List' entry Stephen suggested:

> Name           DSLI  Description                                   Info
> -------------  ----  --------------------------------------------  -----
> LockDisplay    RdpO  Create screen saver, wait password response   LUSOL

> Isn't 'Create' dispensable?  How about?

>                      Screen saver widget + opt. password response
> or
>                      Screen saver/lock widget with opt. animation

> Comments?

Many thanks for all of your.

Quote:

> Achim
> P.S.
> Site note about POD:  While perfectly legal to split POD into it's
> own file like you did:

>         LockDisplay.pm
>         LockDisplay.pod

> Tk will neither 'prefer' nor 'discourage' this style.
> That all POD docs in the base Tk distribution are currently in their own
> files under pod/ was just done to make 'global' substitutions easier.
> So mix pod with code or add pod after __END__ or put pod into it's
> own file just as you like.

The pod was origianlly after __END__, but I had trouble getting make install
to manify it.... if I can figure out the problem pod will go back into PM file.

Steve
==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Fri, 02 Mar 2001 03:00:00 GMT  
 New widget: Tk::LockDisplay

 > >
 > > Jooh, so next TPJ will have an interesting Tk article?  :-)
 >
 > The thought occurred to me, now that you've put me on the spot!
 > I'd like to do one more for the year.... was planning a Win32
 > article.  Any ideas out there?

A registry browser?  There is Tk::Tree and Win32::Registry ...

 > >

 > >  > If anyone cares, or has comments, from the README:
 > >
 > > 2 cents:
 >
 > OK, I learned my lesson:  the reason we all should post widgets here
 > is for community feedback (-:
 >
 > >
 > >         o Tk::LockDisplay has no $VERSION defined so CPAN.pm 'r' command
 > >           can not do it's job.
 >
 > Good catch.  Got confused with Win 32 PPM who doesn't use version from the .PM
 > file but rather the Makefile.PL.  I used to do VERSION_FROM and point to the
 > source file so I didn't have to keep version data in more than one location.
 > So now I need version in source code and Makefile...
 >
 > >
 > >         o play save: use base should have Tk::Derived as first element
 >
 > OK.
 >
 > >
 > >         o Use a '=for category' that is already used by Tk distribution
 > >           if possible.  So a Tk module index page has not to many sub-
 > >           groups.
 >
 > OK, that's news to me, thanks.

No wonder.  AFAIK on Nicks 'in the work' POD 2 HTML converter knows
what to do with it.

 > >
 > >         o Tk::LockDisplay requires 5.005. Is this necessary? If yes I
 > >           would suggest to add this to README and add a use 5.005 to
 > >           Makefile.PL.
 >
 > I'll pull the *one* (I think) 5.005 statement so it works with 5.004.
 >
 > >
 > >         o better name for -velocity.  Currently smaller values means
 > >           faster was is not optimal.
 >
 > Lazyness got the best of me.  Once velocity's definition changed, well...
 >
 > >
 > >         o Wouldn't -animationcmd be a better name than -mesmerize
 > >           Adding a some sort of animation extension mechanism would be
 >
 > The name could use changing, for sure.
 >
 >
 > >           a plus. E.g.,
 > >
 > >                 -animation => 'my_favorite'
 > >
 > >           would try to invoke
 > >
 > >                 &Tk::LockDisplay::my_favorite::Amination($canvas)
 >
 > I already allow -animation => sub {}, is that good enough?

It's more than enough for a perl hacker.  The advantage off a
'animation plugin' interface would make sense if the animations
could be reused, like for widget demos, or a tklock config
window that allows to try a thumb nail version of the animation.

 > >
 > >           If somebody is in the mud: generalize the 'Bouncing
 > >           Ball' demo to the useable as for the screen saver and
 > >           'lines' as a canvas demo.
 >
 > On my list, way at the bottom.

Keep it there until there is someone with a patch and not only
100 ideas for you to implement. :-)

 > >
 > >         o A negative velocity setting could be used to disable
 > >           animation.  Maybe a dummy animation mode 'none' is
 > >           a better solution?
 >
 > Similar to Roderick's request..... must grok how to do this.
 >
 > >
 > >         o Make tklock (also) work with more wide spread passwd/NIS,
 > >           not only esoteric AFS :-)
 >
 > Tk::LockDisplay was to be the only "deliverable" - tklock was mine...
 > we'll see (-:
 >
 > >
 > >           Are you planning exhancements for tklock script?  Should
 > >           tklock get an entry in the Scripts section of the 'Tk
 > >           module list'?
 >
 > As above, we'll see...
 >
 > >
 > > Here the 'Tk Module List' entry Stephen suggested:
 > >
 > > Name           DSLI  Description                                   Info
 > > -------------  ----  --------------------------------------------  -----
 > > LockDisplay    RdpO  Create screen saver, wait password response   LUSOL
 > >
 > > Isn't 'Create' dispensable?  How about?
 > >
 > >                      Screen saver widget + opt. password response
 > > or
 > >                      Screen saver/lock widget with opt. animation
 > >
 > > Comments?
 >
 > Many thanks for all of your.
 >
 > >
 > > Achim
 > > P.S.
 > > Site note about POD:  While perfectly legal to split POD into it's
 > > own file like you did:
 > >
 > >         LockDisplay.pm
 > >         LockDisplay.pod
 > >
 > > Tk will neither 'prefer' nor 'discourage' this style.
 > > That all POD docs in the base Tk distribution are currently in their own
 > > files under pod/ was just done to make 'global' substitutions easier.
 > > So mix pod with code or add pod after __END__ or put pod into it's
 > > own file just as you like.
 >
 > The pod was origianlly after __END__, but I had trouble getting make install
 > to manify it.... if I can figure out the problem pod will go back into PM file.

I think it's a general MakeMaker problem/feature (at least on Unix).  It's
the same for 'make test'.

Only the default target 'all' has a POD dependency:

all :: pure_all manifypods

'test' and 'install' only depend on 'pure_all'.

Achim
P.S. Same behaviour for Nick's MakeMaker variation, using
     use Tk::MMutil; Tk::MMutil::TkExtMakefile(...)
 >
 > Steve

==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Fri, 02 Mar 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. [Fwd: CPAN Upload: LUSOL/Tk-LockDisplay-1.1.tar.gz]

2. New Tk::ObjEditor widget

3. Tk::CodeText new Text widget, capable of syntax highlighting

4. New Tk::ObjEditor widget

5. new widget: Tk::XMLViewer

6. Can Tk Widget and Xt Widget work together?

7. Is there a Tree widget in perlTk that resembles the Tree widget in Tk

8. RFQ: Tk::Wizard - a wizard style widget for Perl/Tk

9. BETA TEST: Tk::Tie::MenuHash - Ties a Tk::Menubutton widget to a hash, kinda

10. BETA TEST: Tk::Tie::MenuHash - Ties a Tk::Menubutton widget to a hash, kinda

11. RFQ: Tk::Wizard - a wizard style widget for Perl/Tk

12. New Module: Tk::DDTList - sophisticated Tk::BrowseEntry

 

 
Powered by phpBB® Forum Software