Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Log4perl and Tkx

by jellisii2 (Hermit)
on Nov 23, 2011 at 21:59 UTC ( [id://939751]=note: print w/replies, xml ) Need Help??


in reply to Re: Log4perl and Tkx
in thread Log4perl and Tkx

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://939751]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-03-28 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found