Forest-Tree-Viewer-Gtk2

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

---
abstract: 'display a Forest::Tree as a gtk tree view'
author:
  - 'Pawel Murias'
build_requires: {}
configure_requires:
  ExtUtils::MakeMaker: 6.31
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.101900, CPAN::Meta::Converter version 2.101670'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html

Makefile.PL  view on Meta::CPAN

use strict;
use warnings;



use ExtUtils::MakeMaker 6.31;



my %WriteMakefileArgs = (
  'ABSTRACT' => 'display a Forest::Tree as a gtk tree view',
  'AUTHOR' => 'Pawel Murias',
  'BUILD_REQUIRES' => {},
  'CONFIGURE_REQUIRES' => {
    'ExtUtils::MakeMaker' => '6.31'
  },
  'DISTNAME' => 'Forest-Tree-Viewer-Gtk2',
  'EXE_FILES' => [],
  'LICENSE' => 'perl',
  'NAME' => 'Forest::Tree::Viewer::Gtk2',
  'PREREQ_PM' => {
    'Gtk2' => '1.222',
    'Moose' => '1.08',
    'Test::use::ok' => '0.02'
  },
  'VERSION' => '0.03',
  'test' => {
    'TESTS' => 't/*.t'
  }
);

README  view on Meta::CPAN



This archive contains the distribution Forest-Tree-Viewer-Gtk2,
version 0.03:

  display a Forest::Tree as a gtk tree view

This software is copyright (c) 2010 by Pawel Murias.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.


display  view on Meta::CPAN

#!/usr/bin/perl
use v5.10;
use warnings;
use strict;
use lib 'lib';
use Gtk2 -init;
use Forest::Tree::Viewer::Gtk2;
use Forest::Tree;
use Forest::Tree::Reader::SimpleTextFile;

my $reader = Forest::Tree::Reader::SimpleTextFile->new;
$reader->read(\*DATA);

my $tree = Forest::Tree->new(node=>'root',children=>[
    Forest::Tree->new(node=>'child1'),
    Forest::Tree->new(node=>'child2'),
]);

my $viewer = Forest::Tree::Viewer::Gtk2->new(tree=>$tree);
my $window = Gtk2::Window->new('toplevel');
$window->add($viewer->view);
$window->show_all;

Gtk2->main;


__DATA__
root
    1.0

lib/Forest/Tree/Viewer/Gtk2.pm  view on Meta::CPAN

# ABSTRACT: display a Forest::Tree as a gtk tree view
package Forest::Tree::Viewer::Gtk2;
use Gtk2;
use Moose;
has tree=>(is=>'ro');
has column_name=>(is=>'ro',default=>"?");
sub _append_to_tree_store {
    my ($tree,$tree_store,$parent) = @_;
    my $iter = $tree_store->append($parent);
    $tree_store->set($iter,0=>,$tree->node);
    for (@{$tree->children}) {
        _append_to_tree_store($_,$tree_store,$iter);

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.190 second using v1.00-cache-2.02-grep-82fe00e-cpan-58dc6251afda )