Gtk2
view release on metacpan or search on metacpan
t/01.GtkWindow.t view on Meta::CPAN
$win2->add_mnemonic($mnemonic, $label);
ok(1);
ok( defined $win2->mnemonic_activate($mnemonic, "shift-mask") );
SKIP: {
skip "activate_key and propagate_key_event are new in 2.4", 2
unless Gtk2->CHECK_VERSION (2, 4, 0);
my $event = Gtk2::Gdk::Event::Key->new ("key-press");
$event->keyval ($Gtk2::Gdk::Keysyms{ A });
ok ( ! $win2->activate_key ($event) );
ok ( ! $win2->propagate_key_event ($event) );
}
$win2->remove_mnemonic($mnemonic, $label);
ok(1);
$win2->set_mnemonic_modifier("control-mask");
ok(1);
is_deeply(\@{ $win2->get_mnemonic_modifier }, ["control-mask"]);
$win2->set_focus;
ok(1);
$win2->set_focus(Gtk2::Entry->new());
ok(1);
my $button = Gtk2::Button->new ('i can default!');
$button->can_default (TRUE);
$win2->set_default($button);
$win2->set_decorated(TRUE);
ok(1);
ok( $win2->get_decorated );
$win2->set_has_frame(FALSE);
ok(1);
ok( !$win2->get_has_frame );
$win2->set_role('tool');
ok(1);
is( $win2->get_role, 'tool' );
foreach (qw/normal dialog menu toolbar/)
{
$win2->set_type_hint($_);
ok(1);
is( $win2->get_type_hint, $_ );
}
SKIP: {
skip 'stuff missing in 2.0.x', 6
unless Gtk2->CHECK_VERSION (2, 2, 0);
foreach (qw/splashscreen utility dock desktop/)
{
$win2->set_type_hint($_);
is( $win2->get_type_hint, $_ );
}
SKIP: {
skip 'taskbar stuff missing on windows', 1
if $^O eq 'MSWin32';
$win2->set_skip_taskbar_hint('true');
ok( $win2->get_skip_taskbar_hint );
}
$win2->set_skip_pager_hint('true');
ok( $win2->get_skip_pager_hint );
}
ok( ! $win->get_default_icon_list );
# need pixbufs
#$win->set_default_icon_list(...)
# need file
#$win->set_default_icon_from_file(...)
# need a pixbuf
#$win->set_icon($pixbuf);
# doesn't have an icon ^
ok( ! $win->get_icon );
# doesn't have an icon ^
ok( ! $win->get_icon_list );
my $accel_group = Gtk2::AccelGroup->new;
$win->add_accel_group ($accel_group);
$win->remove_accel_group ($accel_group);
# we can set this here, but we'll have to wait until events have
# been handled to check them. see the run_main block, below.
$win->set_frame_dimensions(0, 0, 300, 500);
ok( $win2->parse_geometry("100x100+10+10") );
SKIP: {
skip 'set_auto_startup_notification is new in 2.2', 0
unless Gtk2->CHECK_VERSION(2, 2, 0);
$win2->set_auto_startup_notification(FALSE);
}
SKIP: {
skip 'tests that show the window', 20;
$win->show;
ok(1);
( run in 1.806 second using v1.01-cache-2.11-cpan-437f7b0c052 )