Cut and paste on HList::Tree

Pat R <[email protected]> Fri, 30 Mar 2007 08:39:47 -0700 (PDT)
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
Hi,
   
  I'm trying to implement cut and paste functionality on a Tree widget, basically when the user selects one entry and right-click a menu shows up with the options Cut, Copy, Paste before, Paste after. Cut and copy work fine, paste works when the new entry is inserted at the end of the tree but the program crashes when I use options -at, -before and -after.
  Any help will be greatly appreciated.
   
  Thanks
  Patricia
   
  This is the part of my script that crashes
        $menu = $db->Menu( -tearoff   => 0,
                         -menuitems =>[ 
                                                   ['command'=>'Paste Before', 
                                                            -command => sub{   print "Paste Before \n";
                                                               $parent = $tests_list->infoParent($index[0]);
               # This works                $tests_list->addchild($parent, -text => $item_sel);
                # Next 2 crash
                                       $tests_list->add($parent,-before =>$index[0], -text => $item_sel);
                                     $tests_list->add($parent,-at=>1, text=>$item_sel
                                                    }],
   

 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and 
always stay connected to friends.

--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk