File: GtkComboBoxEntry.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 (48 lines) | stat: -rw-r--r-- 1,435 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
#
# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkComboBoxEntry.t,v 1.8 2006/01/18 19:04:10 kaffeetisch Exp $
#

use Gtk2::TestHelper
	at_least_version => [2, 4, 0, "GtkComboBoxEntry is new in 2.4"],
	tests => 9;

my $entry_box;

$entry_box = Gtk2::ComboBoxEntry->new;
isa_ok ($entry_box, 'Gtk2::ComboBoxEntry');
ginterfaces_ok($entry_box);

my $model = Gtk2::ListStore->new (qw/Glib::String Glib::Int Glib::String/);
foreach (qw/a b c d e f g/) {
	$model->set ($model->append, 0, $_, 1, ord($_), 2, ord($_)**2);
}
$entry_box->set_model ($model);
is ($entry_box->get_model, $model);
$entry_box->set_text_column (2);
is ($entry_box->get_text_column, 2);

my $text_column = 1;
$entry_box = Gtk2::ComboBoxEntry->new ($model, $text_column);
isa_ok ($entry_box, 'Gtk2::ComboBoxEntry');
is ($entry_box->get_text_column, $text_column);

$text_column = 0;
$entry_box = Gtk2::ComboBoxEntry->new_with_model ($model, $text_column);
isa_ok ($entry_box, 'Gtk2::ComboBoxEntry');
is ($entry_box->get_text_column, $text_column);

$entry_box->get_child->set_editable (TRUE);
$entry_box->get_child->set_text ('whee');

#my $dlg = Gtk2::Dialog->new ('foo', undef, [], 'gtk-cancel' => 'cancel');
#$dlg->vbox->add ($entry_box);
#
#$dlg->show_all;
#$dlg->run;

isa_ok (Gtk2::ComboBoxEntry->new_text, 'Gtk2::ComboBoxEntry');

__END__

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