File: dial.pl

package info (click to toggle)
libgtk-perl 0.7009-12
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,956 kB
  • ctags: 2,260
  • sloc: perl: 13,998; xml: 9,919; ansic: 2,894; makefile: 64; cpp: 45
file content (64 lines) | stat: -rwxr-xr-x 2,179 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/perl

$NAME = 'Dial';

use Gnome;

init Gnome "dial.pl";

                $range_window = new Gtk::Window -toplevel;
                $range_window->signal_connect("destroy", sub { exit });
                $range_window->set_title("range controls");
                $range_window->border_width(0);
                
                $box1 = new Gtk::VBox(0,0);
                $range_window->add($box1);
                $box1->show;
                
                $box2 = new Gtk::VBox(0,10);
                $box2->border_width(10);
                $box1->pack_start($box2, 1, 1, 0);
                $box2->show;
                
                $adjustment = new Gtk::Adjustment(0.0, 0.0, 101.0, 0.1, 1.0, 1.0);
                
                $scale = new Gtk::HScale($adjustment);
                $scale->set_usize(150,30);
                $scale->set_update_policy(-delayed);
                $scale->set_digits(1);
                $scale->set_draw_value(1);
                $box2->pack_start($scale, 1, 1, 0);
                $scale->show;
                
                $scrollbar = new Gtk::HScrollbar $adjustment;
                $scrollbar->set_update_policy(-continuous);
                $box2->pack_start($scrollbar, 1, 1, 0);
                $scrollbar->show;

                
                $dial = new Gtk::Dial $adjustment;
                $dial->set_update_policy(-continuous);
                $box2->pack_start($dial, 1, 1, 0);
                $dial->show;
                
                $separator = new Gtk::HSeparator;
                $box1->pack_start($separator, 0, 1, 0);
                $separator->show;
                
                $box2 = new Gtk::VBox(0,10);
                $box2->border_width(10);
                $box1->pack_start($box2, 0, 1, 0);
                $box2->show;
                
                $button = new Gtk::Button "close";
                $button->signal_connect("clicked", sub {destroy $range_window});
                $box2->pack_start($button, 1, 1, 0);
                $button->can_default(1);
                $button->grab_default;
                show $button;


show $range_window;
			

main Gtk;