This may be an area of confusion for me.

When I said "the routines are called like"...I meant my "key handler routine" is called by Tk with a calling sequence that looks like: "$main_win->handle_key($s, Ev('A'), Ev('K'))", where "$s" is the main "self" data structure/pointer."

i.e. The bind for my "handle_key" routine is:

{ use Tk; #needed for "Ev" defines next code line $retval = $main_win -> bind('<Any-KeyPress>' => [\&handle_key, $s, Ev('A'), Ev('K')]); }
From the man page on Tk::callbacks, I see:
Another use of arguments allows you to write generalized method +s which are easier to re-use: $a->bind("<Next>",['Next','Page']); $a->bind("<Down>",['Next','Line']); This will call $a->Next('Page') or $a->Next('Line') respectivel +y.
From my call sequence:
"$main_win" -> bind('<Any-KeyPress>', \&handle_key, $s, Ev('A'), Ev('K'));"
I'd expect "handle_key" to be entered with the following in '@_':
my ($main_win, $s, $EvA, $EvK) = @_;
I assume "$main_win (handle of win I'm binding to) to be first, and the other 3 args should taken from my bind statement.

I pass the key_handler routine addr to Tk via the bind, but it is from the man pages I get that they are calling &handle_key as being called through the "$main_win" handle. I pass my 1 object (at top level is a singleton, I believe the terminology is) -- that contains the "database" I'm sequencing through. The routine that has the bind statement in it, is passed "$s" ($self), which it passes in a param list to &handle_key. I then try to invoke methods on the "$self" object that is passed in via the parameter list. It is some of those "methods" that the "call" should find in Base classes but isn't (doesn't seem to be searching through the base classes at all).

Did that clarify anything or where I might be using it incorrectly?
Sorry for any confusion....
L


In reply to Re^2: Missing base classes when called from Tk by perl-diddler
in thread Missing base classes when called from Tk by perl-diddler

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.