App-SourcePlot

 view release on metacpan or  search on metacpan

lib/App/SourcePlot.pm  view on Meta::CPAN


    my $title = sprintf "%5s  %-16s  %-12s  %-13s  %-4s", 'Index', 'Name',
        'Ra', 'Dec', 'Epoc';
    $head->insert('end', $title);
    $head->configure(-state => 'disabled');

    # create the scollable text
    my $T = $topFrame->Scrolled(
        'Text',
        -scrollbars => 'e',
        -background => '#333333',
        -wrap => 'none',
        -width => 60,
        -height => 15,
        -font => '-*-Courier-Medium-R-Normal--*-120-*-*-*-*-*-*',
        -setgrid => 1,
    )->grid(-sticky => 'nsew', -row => 1);
    $T->bindtags(qw/widget_demo/); # remove all bindings but dummy "widget_demo"

    $topFrame->gridRowconfigure(1, -weight => 1);
    $topFrame->gridColumnconfigure(0, -weight => 1);

lib/App/SourcePlot.pm  view on Meta::CPAN

    # Clear the existing widgets
    if (defined $task && $task eq 'full') {
        $T->delete('1.0', 'end');
        foreach my $source (@sources) {
            $T->tagDelete('d' . $source->index());
        }
    }

    # Set up display styles
    if ($T->depth > 1) {
        @bold = ('-background' => '#eeeeee', '-relief' => 'raised', '-borderwidth' => 1);
        @normal = ('-background' => undef, '-relief' => 'flat');
    }
    else {
        @bold = ('-foreground' => 'white', '-background' => 'black');
        @normal = ('-foreground' => undef, '-background' => undef);
    }
    $T->tag(configure => 'normal', '-foreground' => 'blue');
    $T->tag(configure => 'inactive', '-foreground' => 'black');
    $T->tag(configure => 'selected', '-foreground' => 'red');
    foreach (@COLOR_LIST) {
        $T->tag('configure', $_, '-foreground' => $_);
    }

    # Insert the current values
    if (defined $task && $task eq 'full') {

lib/App/SourcePlot.pm  view on Meta::CPAN

                        $prevy = $y;
                    }
                    @points = @second;

                }
                my $len2 = @points;
                $plotter->drawSmoothLine(@points, 'l' . $source->name())
                    if ($len2 > 0);

                my @bold = (
                    '-background' => "#bbbbbb",
                    '-foreground' => 'black',
                    '-relief' => 'raised',
                    '-borderwidth' => 1,
                );
                my @normal = (
                    '-background' => undef,
                    '-foreground' => $source->color(),
                    '-relief' => 'flat',
                );
                $plotter->bindTag(
                    'l' . $source->name(),
                    '<Any-Enter>' => sub {
                        my $s = $source;
                        if ($s->active()) {
                            $EditWin->{'Text'}->tag('configure', 'd' . $s->index(), @bold)
                                if $EDIT_OPEN;

lib/App/SourcePlot/Plotter/Tk.pm  view on Meta::CPAN

    my $height = shift;

    my $ET = bless {
        FONT => '-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
        FONT_COLOR => 'Black',
        DRAW_COLOR => 'Black',
        PEN_WIDTH => 1,
    }, $class;

    $ET->{CANVAS} = $screen->Canvas(
        -background => "LightCyan3",
        -relief => 'raised',
        -width => $width,
        -height => $height,
        -cursor => 'top_left_arrow',
    );
    $ET->{CANVAS}->grid(-row => 0, -column => 0, -sticky => 'nsew');

    $ET->setWorldSize(0, 0, 1, 1);
    $ET->usingWorld(0);

lib/App/SourcePlot/Plotter/Tk.pm  view on Meta::CPAN


=cut

sub height {
    my $self = shift;
    return $self->getCanvas->height;
}

=item setBackground

Sets the background color

    $plotter->setBackground('black');

=cut

sub setBackground {
    my $self = shift;
    my $color = shift;
    $self->getCanvas()->configure(-background => $color);
}

=item setForeground

Sets the foreground color.

    $plotter->setForeground('black');

=cut



( run in 3.059 seconds using v1.01-cache-2.11-cpan-0d23b851a93 )