<debug>
Controlling the Laszlo debugger console window

JavaScript: lz.debug
extends <view> » <node> » lz.Eventable »

For runtimes that use a view on the application canvas as the debugger console window, the optional <debug /> tag controls the appearance of window. The <debug /> tag does not cause the application to be compiled with debugging mode enabled.

When applicable, by default, the debug console will appear as a view sized to fit the lower 1/2 of the canvas. The usual view attributes can be used to override these defaults to size and position the debug console window. If you need to programmatically control the debugger console window, use the name attribute:

Example 2. Controlling the Debug console window

<canvas debug="true" height="150" width="100%">
 <debug name="debugwindow" y="${canvas.height - this.height}" height="80%"/>
 <button name="button">
   <attribute name="visible" value="${canvas['debugwindow'] != null}"/>
   <attribute name="text" value="${canvas['debugwindow']?((canvas.debugwindow.visible?'hide':'show') + ' debugger'):null}"/>
   <handler name="onclick">
     canvas.debugwindow.setAttribute('visible', (! canvas.debugwindow.visible));
   </handler>
 </button>
</canvas>

Note the test to verify that the window exists before we try to manipulate it. The <debug /> tag will not create a window in the application canvas for runtimes or IDE's that have an external debugger console, or if remote or developer console debugging is enabled.

When the debugger is active, there is a menu item in the default contextual (right-click) menu that can be used to show or hide the debugger window. The debugger will add a number of useful actions to the contextual menu when the debugger window is visible. If an error occurred in the program, there will be actions to examine the error in detail or to generate a bug report.

Methods

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy