I am working with the Tk::LineNumberText widget. As an argument it takes the type of widget (has to be derived from Tk::Text) that you want the text part to be. I've been experimenting with Tk::CodeText and the results where good. Line numbers and highlighting was all working as it should. Then I saw the oh so nifty autoindent feature and turned that on for the CodeText widget. Now the CodeText widget binds to 'return' to do the indenting, and the LineNumberText wants to overright that binding to see that the user is on a new line. I've been tweaking LineNumberText to see if i can get it to play nice but i just don't seem to grasp the order of events with bindings. I had hoped that if i bound the 'return' event of the frame parenting the text widget, that it would get called after the text widgets own event. This is not the case, or at least doesn't appear to be.

Is there some way to have two bindings for a single event on a single widget OR to somehow use inheritance/parenting to acheive that same end. Obviously I could just hand modify both modules to play nice with the other, but i was hoping for some more general method that could be used to patch one or the other in hopes of future prosperity.

Thanks in advance for any assitance you can provide.


___________
Eric Hodges

In reply to Tk bindings by eric256

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.