![]() |
![]()
| ![]() |
![]()
NAMEReaction::UI::FocusStack - A linked list of ViewPort-based objects SYNOPSISmy $stack = Reaction::UI::FocusStack->new(); # Or more commonly, in a Reaction::UI::RootController based # Catalyst Controller: my $stack = $ctx->focus_stack; # Add a new basic viewport inside the last viewport on the stack: my $vp = $stack->push_viewport('Reaction::UI::ViewPort' => layout => 'xhtml' ); # Fetch the innermost viewport from the stack: my $vp = $stack->pop_viewport(); # Remove all viewports inside a given viewport: $stack->pop_viewports_to($vp); # Create a named stack as a tangent to an existing viewport: my $newstack = $vp->create_tangent('somename'); # Resolve current events using your stack: # This is called by Reaction::UI::RootController in the end action. $stack->apply_events($ctx, $param_hash); DESCRIPTIONA FocusStack represents a list of related ViewPort objects. The Reaction::UI::RootController creates an empty stack for you in it's begin action, which represents the main thread/container of the page. Typically you add new ViewPorts to this stack as the main parts of your page. To add multiple parallel page subparts, create a tangent from the outer viewport, and add more viewports as normal. METHODSnewCreate a new empty FocusStack. This is done for you in Reaction::UI::RootController. push_viewportCreates a new Reaction::UI::ViewPort based object and adds it to the stack. The following attributes of the new ViewPort are set:
pop_viewportRemoves the last/innermost ViewPort from the stack and returns it. pop_viewports_toPops all ViewPorts off the stack until the given ViewPort object remains as the last item. If passed a $viewport not on the stack, this will empty the stack completely (and then die complainingly). TODO: Should pop_viewports_to check $vp->focus_stack eq $self first? vp_headRetrieve the first ViewPort in this stack. Useful for calling "render_viewport" in Reaction::UI::Window on a "focus_tangent" in Reaction::UI::ViewPort. vp_headRetrieve the first ViewPort in this stack. Useful for calling "render_viewport" in Reaction::UI::Window on a "focus_tangent" in Reaction::UI::ViewPort. vp_tailRetrieve the last ViewPort in this stack. Useful for calling "render_viewport" in Reaction::UI::Window on a "focus_tangent" in Reaction::UI::ViewPort. vp_countloc_prefixapply_eventsInstruct each of the ViewPorts in the stack to apply the given events to each of it's tangent stacks, and then to itself. These are applied starting with the last/innermost ViewPort first. AUTHORSSee Reaction::Class for authors. LICENSESee Reaction::Class for the license.
|