Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Log4perl and Tkx

by Anonymous Monk
on Nov 23, 2011 at 21:13 UTC ( [id://939741]=note: print w/replies, xml ) Need Help??


in reply to Log4perl and Tkx

Would pointing a Log::Log4perl::Appender::String object at the scalar holding your textbox data do the job, or am I misunderstanding your question?

TJD

Replies are listed 'Best First'.
Re^2: Log4perl and Tkx
by jellisii2 (Hermit) on Nov 23, 2011 at 21:59 UTC
    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://939741]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-24 06:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found