POE::XUL::ChangeManager - Keep POE::XUL in sync with the browser DOM
The ChangeManager is responsible for tracking and sending all changes to a POE::XUL::Node to its corresponding DOM element. It also handles any side-effects of a DOM event that was sent from the browser.
There is only one ChangeManager per application. The application never accesses the ChangeManager directly, but rather by manipulating POE::XUL::Node.
Because there may be multiple application instances within a given process, the link between POE::XUL::Node and the ChangeManager is handled by POE::XUL::Event. Changes to a node must happen within "wrap" in POE::XUL::Event. This is done for you in the initial POE event. It must be done explicitly if you chain the initial POE event to furthur POE events.
There is only one method that will be useful for application writers:
pxInstructions( @instructions ); $CM->instruction( $inst ); $CM->instruction( [ $inst, @params ] );
$inst may be simply an instruction name, or an arrayref, the first element of which is the instruction name.
Current instructions are:
Empties all pending changes, returns the arrayref of those changes.
All currently known commands are put into the output buffer. Combined with
timeslice, it allows some control over the order in which commands are executed.
timeslice. The idea is to give the browser time to render any new XBL. Because it is impossible to find out when all XBL has finished rendering, the
timeslice is handled by pausing for 5 milliseconds.
To be very useful, you should preceed this with a "flush".
pxInstruction( [ popup_window => $id, $features ] );
PLEASE USE "open" in POE::XUL::Window INSTEAD.
Tell the client library to create a new window. The new window's name will be
$id. The new window will be created with the features defined in
scrollbars. The following features are always
dependent. See http://developer.mozilla.org/en/docs/DOM:window.open for an explanation of what they mean.
Once the window is opened, it will load
$APP is the current application and
$SID is the session ID of the current application instance).
popup.xul will then send a
connect event. See "connect" in POE::XUL.
pxInstruction( [ close_window => $id ] );
PLEASE USE "close" in POE::XUL::Window INSTEAD.
Closes the window
$id. This will provoke a
disconnect event. See "disconnect" in POE::XUL.
Philip Gwyn <gwyn-at-cpan.org>
Based on XUL::Node by Ran Eilam.
Copyright 2007-2010 by Philip Gwyn. All rights reserved;
Copyright 2003-2004 Ran Eilam. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.