logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

IO::LCDproc - Perl extension to connect to an LCDproc ready display.

Author

       Juan C. Muller, <jcmuller@gmail.com>

Description

       Follow the example above. Pretty straight forward. You create a client, assign a screen, add widgets, and
       then set the widgets.

   IO::LCDproc::Client
       It is the back engine of the module. It generates the connection to a ready listening server.

       METHODS

       new( name => 'Client_Name' [, host => $MYHOSTNAME] [, port => $MYPORTNUMBER] )
                   Constructor. Takes the following possible arguments (arguments must be given in key => value form):
                   host, port, and name. name is required.

       add( SCREENREF )
                   Adds the screens that will be attached to this client.

       connect()
                   Establishes connection to LCDproc server (LCDd).

       initialize()
                   Initializes client, screen and all the widgets  with the server.

       answer()
                   Reads an answer from the server

       flushAnswers()
                   Flushes all answers from the server (should be called regulary if you don't need the answers)

   IO::LCDproc::ScreenMETHODS

       new( name => 'MYNAME')
                   Constructor. Allowed options:
                   heartbeat => 1 or 0.

       add( @WIDGETS )
                   Adds the given widgets to this screen.

       set_prio( $prio )
                   Sets the screen priority with $prio one of

                   hidden          The screen will never be visible
                   background      The screen is only visible when no normal info screens exists
                   info            normal info screen, default priority
                   foreground      an active client
                   alert           The screen has an important message for the user.
                   input           The client is doing interactive input.

   IO::LCDproc::WidgetMETHODS

       new( name => 'MYNAME' )
                   Constructor. Allowed arguments:
                   align (left, center, rigth), type (string, title, vbar, hbar, ...), xPos, yPos, data

       set()
              Sets the widget to the spec'd args. They may be given on the function call or the may be
              pre specified.
              xPos, yPos, data

       save()
                   Saves current data to be user later.

       restore()
                   Restore previously saved data. (Implicitly calls set)

Name

       IO::LCDproc - Perl extension to connect to an LCDproc ready display.

See Also

       LCDd

Synopsis

               use IO::LCDproc;

               my $client      = IO::LCDproc::Client->new(name => "MYNAME");
               my $screen      = IO::LCDproc::Screen->new(name => "screen");
               my $title       = IO::LCDproc::Widget->new(
                               name => "date", type => "title"
                               );
               my $first       = IO::LCDproc::Widget->new(
                               name => "first", align => "center", xPos => 1, yPos => 2
                               );
               my $second      = IO::LCDproc::Widget->new(
                               name => "second", align => "center", xPos => 1, yPos => 3
                               );
               my $third       = IO::LCDproc::Widget->new(
                               name => "third", xPos => 1, yPos => 4
                               );
               $client->add( $screen );
               $screen->add( $title, $first, $second, $third );
               $client->connect() or die "cannot connect: $!";
               $client->initialize();

               $title->set( data => "This is the title" );
               $first->set( data => "First Line" );
               $second->set( data => "Second line" );
               $third->set( data => "Third Line" );

               $client->flushAnswers();

See Also