Philip Gwyn > POE-XUL-0.0600 > POE::XUL::ChangeManager


Annotate this POD


New  1
Open  1
View/Report Bugs
Source   Latest Release: POE-XUL-0.0601


POE::XUL::ChangeManager - Keep POE::XUL in sync with the browser DOM


Not used directly. See POE::XUL and POE::XUL::Event.


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 ] );

Send instructions to the javascript client library. Instructions are a HACK to quickly work around XUL and/or POE::XUL::Node limitations.

$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.


Tells the javascript client library to give up a 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 $features: width, height, location, menubar, toolbar, status, scrollbars. The following features are always yes: resizable, dependent. See for an explanation of what they mean.

Once the window is opened, it will load /popup.xul?app=$APP&SID=$SID (where $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 <>


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.


perl(1), POE::XUL, POE::XUL::Event.

syntax highlighting: