hokiejerm has asked for the wisdom of the Perl Monks concerning the following question:

I have a TK::Tree on the left where I select an item from the tree. On the right, I have information pertaining to the selected item. I used the -browsecmd callback and this works, mostly.

The issue I have is that when no item is selected, I still display stale information for the last item selected. Is there a way to invoke the callback in theis situation with an empty string for the key?

Thanks!

Replies are listed 'Best First'.
Re: TK::Tree delecting item
by zentara (Cardinal) on Dec 16, 2011 at 11:00 UTC
    I still display stale information for the last item selected.

    If you show a small working example of how you display the information, we might be able to show a better way to clear the old info.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: TK::Tree delecting item
by Anonymous Monk on Dec 15, 2011 at 14:57 UTC

    he issue I have is that when no item is selected, I still display stale information for the last item selected.

    so call the function yourself? or generate an event

    See Tk trigger event, eventGenerate

    See Tk::event

    See http://search.cpan.org/grep?cpanid=SREZIC&release=Tk-804.030&string=eventgenerate&i=1&n=1&C=0

    See http://search.cpan.org/dist/Tk/MANIFEST http://search.cpan.org/src/SREZIC/Tk-804.030/Tixish/examples/perl-tix-tree