aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Widget.pm
diff options
context:
space:
mode:
authormatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-02-14 19:08:52 +0000
committermatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-02-14 19:08:52 +0000
commit5b263604e722de27d5d28bd92560d06e8a4bd80b (patch)
treed3c52f6e9e308f9831a9b0677d72eeeff1c545ca /lib/Reaction/UI/Widget.pm
parentdcba6edf121566480fc85003882a3ab3a912e1b1 (diff)
downloadreaction-5b263604e722de27d5d28bd92560d06e8a4bd80b.tar.gz
reaction-5b263604e722de27d5d28bd92560d06e8a4bd80b.zip
widget fragment debug
Diffstat (limited to 'lib/Reaction/UI/Widget.pm')
-rw-r--r--lib/Reaction/UI/Widget.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Reaction/UI/Widget.pm b/lib/Reaction/UI/Widget.pm
index 2c7e00c..422384d 100644
--- a/lib/Reaction/UI/Widget.pm
+++ b/lib/Reaction/UI/Widget.pm
@@ -5,6 +5,8 @@ use aliased 'Reaction::UI::ViewPort';
use aliased 'Reaction::UI::View';
use aliased 'Reaction::UI::LayoutSet';
+sub DEBUG_FRAGMENTS () { $ENV{REACTION_UI_WIDGET_DEBUG_FRAGMENTS} }
+
class Widget which {
has 'view' => (isa => View, is => 'ro', required => 1);
@@ -25,7 +27,13 @@ class Widget which {
implements 'render' => as {
my ($self, $fragment_name, $rctx, $passed_args) = @_;
confess "\$passed_args not hashref" unless ref($passed_args) eq 'HASH';
-#warn "Render: ${fragment_name} for ${self}";
+ if (DEBUG_FRAGMENTS) {
+ my $vp = $passed_args->{viewport};
+ $self->view->app->log->debug(
+ "Rendering fragment ${fragment_name} for ".ref($self)
+ ." for VP ${vp} at ".$vp->location
+ );
+ }
my $args = { self => $self, %$passed_args };
my $new_args = { %$args };
my $render_tree = $self->_render_dispatch_order(