NAME

Tk::Knob - A Knob Tk widget that can turn indefinitely in any direction.

VERSION

Version 0.001

SYNOPSIS

    use Tk;
    use Tk::Knob;
    my $value=0;
    my $svalue="";
    my $mw=Tk::MainWindow->new(-title=>"Knob test");
    my $kf=$mw->Frame->pack;
    $kf->Knob( -width=>100, 
               -height=>100,
	       -knobsize=>49, 
	       -knobrovariable=>\$v,
	       -knobcommand=>\&cmd,
    )->pack->createKnob;

    sub cmd {
	$value=$v;
	$svalue=sprintf "Value: %.2f Hz", $value;
	$svalue.=" OUT OF RANGE (0-10)", if $value>10 or $value < 0;
	$value=0 if $value<0;
	$value=10 if $value > 10;
    }  
    

Creates a circular Knob that can be turned continuously and indefinitely in any direction

DESCRIPTION

Knob Widget that allows the creation of circular knobs that can turn indefinitely to produce arbitrary positive or negative values.

FUNCTIONS

Knob

Make a Knob object and pass it initialization parameters. They may also be set and interrogated with Tk's 'configure' and 'cget'.

-width (500)
-height (500)
-knobsize (250)
-knobvalue (0)
-knobcolor ('DarkGrey')
-knobborder (2)
-knobbordercolor1 ('grey38')
-knobbordercolor2 ('grey99')
-knobrovariable (undef)
-knobcommand (sub {return})

createKnob

Displays the knob, sets its initial parameters, binds the callback routines.

Not to be called by the user directly

ClassInit

Calls the base class initializer

Populate

Sets default values for the class parameters.

pushed

Routine called when button 1 is pushed

rotate

Routine called to rotate knob when the mouse moves

AUTHOR

W. Luis Mochán, Instituto de Ciencias Físicas, UNAM, México mochan@fis.unam.mx

ACKNOWLEDGMENTS

This work was partially supported by DGAPA-UNAM under grants IN108413 and IN113016.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 61:

Unknown directive: =head

Around line 64:

'=item' outside of any '=over'