Yet again, I'm confused. It's late and I've spent most of the day working on this, so that may be why I missed it (or not :)

However, an error, seemingly out of no where popped up. I've been working on a callback function bound to a Button-1 click on a certain image type. Fine. Everything worked. Well, then I copied that line to another place in the file (reason would require knowledge of subroutine, which I don't think is needed for the question), and did some slight changes.

AND THEN...

NOTHING! Same thing as before, but the function was never entered! I removed the (rather commented out the) code I added, but still nothing. So it must have been something somehow got changed in the bind statement, or an assignment to some value that affects that -- but having beens staring at this code far too long I can't spot it (or maybe I'm looking in the wrong place). Here's what I think is relavent:

my $card_dir = 'C:\tk_proj\cards\gif'; my $ext = 'gif'; my $back = $canvas->Photo(-file => "$card_dir\\b1fv.$ext", -format => 'gif'); ... my $dk_img = $canvas->createImage(50,120, -image => $back); ... $canvas->bind($dk_img, "<Button-1>", [\&dk_clk, $deck, $waste]);

Anything I changed in the sub wouldn't take effect (it seems to me) untill the sub was called, so that can't be it. The sub isn't even being called.


In reply to Tk binding slip up (dissapearance?) by dimmesdale

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.