GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Umph::Prompt(3) User Contributed Perl Documentation Umph::Prompt(3)

Umph::Prompt - Interactive prompt for Umph

  my @items;
  push @items, {title => 'foo', url => 'http://foo', selected => 0};
  push @items, {title => 'bar', url => 'http://bar', selected => 0};

  my $p = new Umph::Prompt(

    # Commands.
    commands => {
      q => sub {
        my ($p, $args) = @_;
        $p->exit(\@items, $args);
      },
      d => sub {
        my ($p, $args) = @_;
        $p->display(\@items, $args);
      },
      m => sub {
        my ($p, $args) = @_;
        $p->max_shown_items(@{$args});
      },
      s => sub {
        my ($p, $args) = @_;
        $p->select(\@items, $args);
      },
      h => sub {
        my ($p, $args) = @_;
        $p->help($args);
      },
    },

    # Callbacks. All of these are optional.
    ontoggle => sub {
      my ($p, $args) = @_;
      $p->toggle(\@items, $args);
    },
    onloaded => sub {
      my ($p, $args) = @_;
      $p->display(\@items, $args);
    },
    onitems => sub {return \@items},

    # Other (required) settings
    total_items     => scalar @items,
    prompt_msg      => 'foo',
    max_shown_items => 20
  );

  $p->exec;

Umph::Prompt is an interactive prompt module for umph and similar programs.

None by default.

  gitweb: <http://repo.or.cz/w/umph-prompt.git>

Toni Gundogdu <legatvs at sign cpan org<gt>

Umph::Prompt is free software, licensed under the LGPLv2.1+.
2011-09-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.