Tk::Dial(3pm)

Tk::Dial3pm

An alternative to the scale widget

Usage

 use Tk::Dial;
 $dial = $top->Dial(-margin =>  20,
                    -radius =>  48,
                    -min    =>   0,
                    -max    => 100,
                    -value  =>   0,
                    -format => '%d');
 margin - blank space to leave around dial
 radius - radius of dial
 min, max - range of possible values
 value  - current value
 format - printf-style format for displaying format

Values shown above are defaults.

Overview

A dial looks like a speedometer: a 3/4 circle with a needle indicating the current value. Below the graphical dial is an entry that displays the current value, and which can be used to enter a value by hand.

The needle is moved by pressing button 1 in the canvas and dragging. The needle will follow the mouse, even if the mouse leaves the canvas, which allows for high precision. Alternatively, the user can enter a value in the entry space and press Return to set the value; the needle will be set accordingly.

To do

 Configure
 Tick marks
 Step size

HISTORY August 1995: Released for critique by pTk mailing list

Releases

4 releases since Debian 1.1 (Buzz); the text changed 3 times.

  1. 1.1
  2. 1.2
  3. 1.3
  4. 2.0

Authors

Roy Johnson, [email protected]

Based on a similar widget in XV, a program by John Bradley, [email protected]

From perl-tk 1:400.202-9 in Debian 2.0 (Hamm). Parsed by carta from the page's man source.