Unfortunately, you can't do that is my understanding of the text widget. Here's the code for creating the text area and modifying the text in the widget, after creating the base canvas:
my $status_text_scrollbar = $logging_grid->new_ttk__scrollbar(); my $status_text = $logging_grid->new_tk__text(); $status_text->configure( -width => 80, -height => 10, -yscrollcommand => [$status_text_scrollbar, "set"], -state => "disabled", ); $status_text_scrollbar->configure( -command => [$status_text, "yview"], -orient => "vertical", ); update_tkx('Update the text in the box, please'); sub update_tkx { my $status_text_string = $_[0]; # text control has to be enabled to write to it. $status_text->configure(-state => "normal"); $status_text->insert("end", $status_text_string); $status_text->see("end"); # Don't want the user editing this... $status_text->configure(-state => "disabled"); Tkx::update(); }
Ideally, it would be nice to be able to call update_tkx() when the l4p event fires. I don't know how to do that, and feed it data from an appender. Otherwise, I'll have to call the sub with the data in the code every time I log something. Not undoable, but it doesn't really help me simplify the logging as much as I'd like.

In reply to Re^2: Log4perl and Tkx by jellisii2
in thread Log4perl and Tkx by jellisii2

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.