X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FReaction%2FUI%2FWindow.pm;h=2865e0eeb1dfb31c67570fb63477f5cfbc65f236;hb=7ea45b2aff36dd61953b1517a1cfb079dcea230c;hp=637f75c769ac7504e17d22bde363b4563de235c0;hpb=52f292b24eca44347e5f1bfcffe4cedf5465766b;p=catagits%2FReaction.git diff --git a/lib/Reaction/UI/Window.pm b/lib/Reaction/UI/Window.pm index 637f75c..2865e0e 100644 --- a/lib/Reaction/UI/Window.pm +++ b/lib/Reaction/UI/Window.pm @@ -6,9 +6,9 @@ use Reaction::UI::FocusStack; use namespace::clean -except => [ qw(meta) ]; -has ctx => (isa => 'Catalyst', is => 'ro', required => 1); +has ctx => (isa => 'Catalyst', is => 'ro', required => 1, weak_ref => 1); has view_name => (isa => 'Str', is => 'ro', lazy_fail => 1); -has content_type => (isa => 'Str', is => 'ro', lazy_fail => 1); +has content_type => (isa => 'Str', is => 'rw', lazy_fail => 1); has title => (isa => 'Str', is => 'rw', default => sub { 'Untitled window' }); has view => ( # XXX compile failure because the Catalyst::View constraint would be @@ -116,35 +116,15 @@ L, it is used to contain all the elements (ViewPorts) that make up the UI. The Window is rendered in the end action of the Root Controller to make up the page. -To add L to the stack, read the -L and L documentation. +To add L to the stack, use the +L method. For more detailed +information, read the L and +L documentation. -Several Window attributes are set by -L when a new Window is created, -these are as follows: +=head1 ATTRIBUTES -=over - -=item ctx - -The current L context object is set. - -=item view_name - -The view_name is set from the L attributes. - -=item content_type - -The content_type is set from the L attributes. - -=item title - -The title is set from the L -window_title attribute. - -=back - -=head1 METHODS +These are set for you by L from +your Root controller configuration. =head2 ctx @@ -154,13 +134,13 @@ window_title attribute. =back -Retrieve/set the current L context object. +The current L context object. =head2 view_name =over -=item Arguments: %viewname? +=item Arguments: $viewname? =back @@ -218,40 +198,7 @@ for this Window. Use L on this to create more elements. An empty FocusStack is created by the Controller::Root when the Window is created. -=head2 render_viewport - -=over - -=item Arguments: $viewport - -=back - - $window->render_viewport($viewport); - - [% window.render_viewport(self.inner) %] - -Calls render on the L object used by this Window. The following -arguments are given: - -=over - -=item ctx - -The L context object. - -=item self - -The ViewPort object to be rendered. - -=item window - -The Window object. - -=item type - -The string that describes the layout from L. - -=back +=head1 METHODS =head2 flush @@ -288,9 +235,8 @@ is called by L. Renders the page into the L body, unless the response status is already set to 3xx, or the body has already been -filled. This calls L with the root -L from the L. This method is -called by L. +filled. This is done via L. This +method is called by L. =head1 AUTHORS