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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
#
# $Header: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/t/GtkToolItem.t,v 1.6 2007/09/15 14:33:00 kaffeetisch Exp $
#
use Gtk2::TestHelper
at_least_version => [2, 4, 0, "Action-based menus are new in 2.4"],
tests => 19;
my $tool_item = Gtk2::ToolItem->new;
isa_ok ($tool_item, 'Gtk2::ToolItem');
$tool_item->set_homogeneous (TRUE);
ok ($tool_item->get_homogeneous);
$tool_item->set_homogeneous (FALSE);
ok (!$tool_item->get_homogeneous);
$tool_item->set_expand (TRUE);
ok ($tool_item->get_expand);
$tool_item->set_expand (FALSE);
ok (!$tool_item->get_expand);
my $tooltips = Gtk2::Tooltips->new;
$tool_item->set_tooltip ($tooltips, 'tip_text', 'tip_private');
$tool_item->set_use_drag_window (TRUE);
ok ($tool_item->get_use_drag_window);
$tool_item->set_use_drag_window (FALSE);
ok (!$tool_item->get_use_drag_window);
$tool_item->set_visible_horizontal (TRUE);
ok ($tool_item->get_visible_horizontal);
$tool_item->set_visible_horizontal (FALSE);
ok (!$tool_item->get_visible_horizontal);
$tool_item->set_visible_vertical (TRUE);
ok ($tool_item->get_visible_vertical);
$tool_item->set_visible_vertical (FALSE);
ok (!$tool_item->get_visible_vertical);
$tool_item->set_is_important (TRUE);
ok ($tool_item->get_is_important);
$tool_item->set_is_important (FALSE);
ok (!$tool_item->get_is_important);
is ($tool_item->get_icon_size, 'large-toolbar');
is ($tool_item->get_orientation, 'horizontal');
is ($tool_item->get_toolbar_style, 'icons');
is ($tool_item->get_relief_style, 'none');
my $menu_item = Gtk2::MenuItem->new;
$tool_item->set_proxy_menu_item ("menu_item_id", $menu_item);
is ($tool_item->retrieve_proxy_menu_item, $menu_item);
is ($tool_item->get_proxy_menu_item ("menu_item_id"), $menu_item);
SKIP: {
skip 'new stuff in gtk+ 2.6', 0
unless Gtk2->CHECK_VERSION (2, 6, 0);
$tool_item->rebuild_menu;
}
SKIP: {
skip 'new 2.12 stuff', 0
unless Gtk2->CHECK_VERSION (2, 12, 0);
$tool_item->set_tooltip_text ('Bla!');
$tool_item->set_tooltip_text (undef);
$tool_item->set_tooltip_markup ('<b>Bla!</b>');
$tool_item->set_tooltip_markup (undef);
}
__END__
Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
full list). See LICENSE for more information.
|