What CPAN modules (other than TK, which is a given) would you recommend to look at?

Look at Gtk2 and it's Treeview widget. DoubleClick an entry at any level to edit it. Gtk2 is not as cross-platform as Tk, but Tk is falling out of favor too on Win32. The latest ActiveState dosn't have Tk included by default anymore, so you need to install stuff anyways. Here is a deeply nested tree with nice tree animation.

#! /usr/bin/perl -w use strict; use Gtk2 '-init'; use Glib qw/TRUE FALSE/; #standard window creation, placement, and signal connecting my $window = Gtk2::Window->new('toplevel'); $window->signal_connect('delete_event' => sub { Gtk2->main_quit; }); $window->set_border_width(5); $window->set_position('center_always'); #this vbox will geturn the bulk of the gui my $vbox = &ret_vbox(); #add and show the vbox $window->add($vbox); $window->show(); #our main event-loop Gtk2->main(); ######################################### sub ret_vbox { my $vbox = Gtk2::VBox->new(FALSE,5); $vbox->set_size_request (300, 300); #this is one of the provided base Gtk2::TreeModel classes. my $tree_store = Gtk2::TreeStore->new(qw/Glib::String/); #fill it with arbitry data foreach my $parent_nr (1..30) { #the iter is a pointer in the treestore. We #use to add data. my $iter = $tree_store->append(undef); $tree_store->set ($iter,0 => "Parent $parent_nr"); foreach my $child (1..3){ #here we append child iters to the parent iter #and add data to those chils iters. my $iter_child = $tree_store->append($iter); $tree_store->set ($iter_child,0 => "Child $child of Pare +nt $parent_nr"); foreach my $gchild (1..3){ #here we append child iters to the parent iter #and add data to those chils iters. my $iter_child = $tree_store->append($ +iter_child); $tree_store->set ($iter_child,0 => "GrandC +hild $gchild of Parent $parent_nr"); } } } #this will create a treeview, specify $tree_store as its model my $tree_view = Gtk2::TreeView->new($tree_store); #create a Gtk2::TreeViewColumn to add to $tree_view my $tree_column = Gtk2::TreeViewColumn->new(); $tree_column->set_title ("Click to sort"); my $renderer = Gtk2::CellRendererText->new; $renderer->set_property('editable' => TRUE); $renderer->signal_connect (edited => \&cell_edited, $tree_ +store); $tree_column->pack_start ($renderer, FALSE); $tree_column->add_attribute($renderer, text => 0); #add $tree_column to the treeview $tree_view->append_column ($tree_column); $vbox->pack_start($tree_view,TRUE,TRUE,0); $vbox->show_all(); return $vbox; } sub cell_edited { my ($cell, $path_string, $new_text, $model) = @_; my $path = Gtk2::TreePath->new_from_string ($path_string); my $column = $cell->get_data ("column"); my $iter = $model->get_iter ($path); $model->set_value ($iter, $column, $new_text); }

I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re: RFC: RPG ;-) by zentara
in thread RFC: RPG ;-) by pobocks

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.