8
unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) {
9
plan skip_all => 'Needs DISPLAY';
19
use_ok('Padre::Wx::Dialog::Preferences');
22
my $padre = new_ok('Padre');
23
my $main = $padre->wx->main;
24
isa_ok( $main, 'Padre::Wx::Main' );
26
# Create the Preferences 2.0 dialog
27
my $dialog = new_ok( 'Padre::Wx::Dialog::Preferences', [$main] );
29
# Check the listview properties
30
my $treebook = $dialog->treebook;
31
isa_ok( $treebook, 'Wx::Treebook' );
33
#my $listview = $treebook->GetListView;
34
#isa_ok( $listview, 'Wx::ListView' );
35
#is( $listview->, 8, 'Found siz items' );
36
#is( $listview->GetColumnCount, 0, 'Found one column' );
37
#is( $listview->GetColumnWidth(-1), 100, 'Got column width' );
39
# Load the dialog from configuration
40
my $config = $main->config;
41
isa_ok( $config, 'Padre::Config' );
42
ok( $dialog->config_load($config), '->load ok' );
44
# The diff (extracted from dialog) to the config should be null,
45
# except maybe for a potential default font value. This is because
46
# SetSelectedFont() doesn't work on wxNullFont.
47
my $diff = $dialog->config_diff($config);
49
is scalar keys %$diff, 1, 'only one key defined in the diff';
50
ok exists $diff->{editor_font}, 'only key defined is "editor_font"';
52
ok !$diff, 'null font loaded, config_diff() returned nothing';
53
ok 1, 'placebo to stick to the plan';