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

UI::Dialog::Gauged - wrapper support of gauge related functions.

Abstract

       UI::Dialog::Gauged is simply another meta-class for UI::Dialog. This class simply has a different order
       of priority than UI::Dialog and only uses backends that support a standard set of gauge related
       functions.

Author

       Kevin C. Krinke, <kevin@krinke.ca>

Bugs

       Please email the author with any bug reports. Include the name of the module in the subject line.

Constructor

new(@options)
       EXAMPLE
            my $d = new( title => 'Default Title', backtitle => 'Backtitle',
                         width => 65, height => 20, listheight => 5,
                         order => [ 'zenity', 'xdialog' ] );

       DESCRIPTION
                 This  is the Class Constructor method. It accepts a list of key => value pairs and uses them as
                 the defaults when interacting with the various widgets.

       RETURNS
                 A blessed object reference of the UI::Dialog::Gauged class.

       OPTIONS
           The (...)'s after each option indicate the default for the option.

           debug=0,1,2 (0)
           order=[zenity,xdialog,cdialog,whiptail] (as indicated)
           PATH=[/bin,/usr/bin,/usr/local/bin,/opt/bin] (as indicated)
           backtitle="backtitle" ('')
           title="title" ('')
           beepbefore=0,1 (0)
           beepafter=0,1 (0)
           height=\d+ (20)
           width=\d+ (65)
           listheight=\d+ (5)

Description

       This class is simply a nice way to try and ensure a GNOME based widget set.

Export

         None

Inherits

         UI::Dialog

Name

       UI::Dialog::Gauged - wrapper support of gauge related functions.

See Also

       PERLDOC
          UI::Dialog
          UI::Dialog::Backend
          UI::Dialog::Backend::CDialog
          UI::Dialog::Backend::Nautilus
          UI::Dialog::Backend::Whiptail
          UI::Dialog::Backend::XDialog
          UI::Dialog::Backend::XOSD
          UI::Dialog::Backend::Zenity

       MAN FILES
          zenity(1), Xdialog(1), dialog(1), whiptail(1), osd_cat(1) and nautilus(1)

Synopsis

         use UI::Dialog::Gauged;
         my $d = new UI::Dialog::Gauged ( title => 'Default title',
                                         height => 20, width => 65 ,
                                         listheight => 5,
                                         order => [ 'zenity', 'xdialog' ] );

         # Either a Zenity or Xdialog msgbox widget should popup,
         # with a preference for Zenity.
         $d->msgbox( title => 'Welcome!', text => 'Welcome one and all!' );

Widget Methods

gauge_start()
       EXAMPLE
            $d->gauge_start( text => 'gauge...', percentage => 1 );

       DESCRIPTION
                 Display a meter bar to the user. This get's the widget realized but requires  the  use  of  the
                 other gauge_*() methods for functionality.

       RETURNS
                 TRUE (1) if the widget loaded fine and FALSE (0) for anything else.

   gauge_inc()
       EXAMPLE
            $d->gauge_inc( 1 );

       DESCRIPTION
                 Increment the meter by the given amount.

       RETURNS
                 TRUE (1) if the widget incremented fine and FALSE (0) for anything else.

   gauge_set()
       EXAMPLE
            $d->gauge_set( 99 );

       DESCRIPTION
                 Set the meter bar to the given amount.

       RETURNS
                 TRUE (1) if the widget set fine and FALSE (0) for anything else.

   gauge_text()
       EXAMPLE
            $d->gauge_text( 'string' );

       DESCRIPTION
                 Set the meter bar message to the given string.

       RETURNS
                 TRUE (1) if the widget set fine and FALSE (0) for anything else.

   gauge_stop()
       EXAMPLE
            $d->gauge_stop();

       DESCRIPTION
                 End  the  meter bar widget process. One of the flaws with gdialog is that the gauge widget does
                 not close properly and requies the end user to close  the  gauge  window  when  100%  has  been
                 reached. This is the second reason why I'm glad gdialog is going the way of the dodo.

       RETURNS
                 TRUE (1) if the widget closed fine and FALSE (0) for anything else.

See Also