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
|
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper
at_least_version => [2, 4, 0, "GtkCellLayout is new in 2.4"],
tests => 4;
# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkCellLayout.t,v 1.5 2006/04/23 14:18:38 kaffeetisch Exp $
my $column = Gtk2::TreeViewColumn -> new();
isa_ok($column, "Gtk2::CellLayout");
my $box = Gtk2::ComboBox -> new();
isa_ok($box, "Gtk2::CellLayout");
my $entry = Gtk2::ComboBoxEntry -> new();
isa_ok($entry, "Gtk2::CellLayout");
# make sure there is a model; early versions of 2.4.x do not check for NULL
# before unreffing the model.
my $model = Gtk2::ListStore->new ('Glib::Int');
$box->set_model ($model);
$entry->set_model ($model);
my $completion = Gtk2::EntryCompletion -> new();
isa_ok($completion, "Gtk2::CellLayout");
my $renderer = Gtk2::CellRendererText -> new();
$completion -> pack_start($renderer, 0);
$completion -> clear();
$completion -> pack_end($renderer, 1);
$completion -> set_attributes($renderer, stock_id => 0);
$completion -> add_attribute($renderer, activatable => 1);
$completion -> clear_attributes($renderer);
$completion -> set_cell_data_func($renderer, sub { warn @_; }, 23);
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
|