in reply to Tk tree open problem

G'day simonz,

Changing

map { $tree()->open($_) } @EntryPaths;

to

$tree->open($_) for @EntryPaths;

will probably get some speed improvements. I can't say how much or whether it would be noticeable.

Do you have similar code for setmode()? Changing map to for here would proably also help; using autosetmode() might help even more.

If you can provide an example of your code with a small number of nodes, we'll have a better idea of what's happening and how it might be improved. Please exclude all code that not's directly related to the issue at hand (e.g. colours, fonts, widget decorations, callbacks for unrelated functions, and so on): these are just noise, from a troubleshooting perspective, and don't help in drilling down to the heart of the issue.

-- Ken

Replies are listed 'Best First'.
Re^2: Tk tree open problem
by simonz (Sexton) on Mar 13, 2014 at 05:13 UTC

    Hi Ken
    Thanks for the reply, I am working on if I can give a small example of my code to make you understand better about the problem.
    Meanwhile , just need one more help on the following error :
    ## parent element "0.0" does not exist at /usr/lib/perl/Tk.pm line 250 ###
    The background is , I am creating a tree structure of different kinds and combinations in terms of root node and their children. Basically everytime the tree is having different branches and nodes in it. This above error is coming for a particular combination.
    Since the tree is very big, right now I cannot give you an example and unable to find where is the goof up happening.
    If you just tell me which direction I should think or what should I look for to get rid of this error would be very helpful.
    Thanks.

      "Meanwhile , just need one more help on the following error :
      ## parent element "0.0" does not exist at /usr/lib/perl/Tk.pm line 250 ###"

      Without seeing your code, I can't help you with that. You'll need to look in /usr/lib/perl/Tk.pm and see what's happening at line 250. Then try to work out how your code is calling that line.

      In the current version (804.032) of Tk, the source (http://cpansearch.perl.org/src/SREZIC/Tk-804.032/Tk.pm) shows line 250 as a simple assignment (my $name = $meth;): I don't see how that would generate an error about a "parent element". You probably have a different version.

      -- Ken