File: GtkSpinButton.t

package info (click to toggle)
libgtk2-perl 1%3A1.140-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,808 kB
  • ctags: 609
  • sloc: perl: 14,245; ansic: 118; makefile: 70
file content (52 lines) | stat: -rw-r--r-- 1,285 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper tests => 12;

# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkSpinButton.t,v 1.6 2006/01/18 19:04:10 kaffeetisch Exp $

my $adjustment = Gtk2::Adjustment -> new(0, 0, 100, 1, 5, 10);

my $spin = Gtk2::SpinButton -> new($adjustment, 0.2, 1);
isa_ok($spin, "Gtk2::SpinButton");
ginterfaces_ok($spin);

$spin -> configure($adjustment, 0.2, 1);

$spin -> set_adjustment($adjustment);
is($spin -> get_adjustment(), $adjustment);

$spin = Gtk2::SpinButton -> new_with_range(0, 100, 5);

$spin -> set_digits(3);
is($spin -> get_digits(), 3);

$spin -> set_increments(5, 20);
is_deeply([$spin -> get_increments()], [5, 20]);

$spin -> set_range(0, 100);
is_deeply([$spin -> get_range()], [0, 100]);

$spin -> set_value(23.42);
is($spin -> get_value_as_int(), 23);
is($spin -> get_value(), 23.42);

$spin -> set_update_policy("if-valid");
is($spin -> get_update_policy(), "if-valid");

$spin -> set_numeric(1);
is($spin -> get_numeric(), 1);

$spin -> spin("end", 10);

$spin -> set_wrap(1);
is($spin -> get_wrap(), 1);

$spin -> set_snap_to_ticks(1);
is($spin -> get_snap_to_ticks(), 1);

$spin -> update();

__END__

Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
full list).  See LICENSE for more information.