Skip to content

PKUI.CORE.dumpViewStack

kerrishotts edited this page Nov 14, 2012 · 1 revision

(part of PKUI.CORE)

Return Type: void

Parameters: [Optional Message ( string )]

Dumps PKUI.CORE.viewStack to the console. Most useful for debugging, especially when view handling goes awry.

A dump looks like this for full-screen handling:

VIEW STACK DUMP as of 11:34
  Any optional message
    [0]: (H) { 0  } testView1
    [1]: (H) { 0  } testView2
    [2]: (V) { 0  } testView3 =CURRENT=
END VIEW STACK DUMP

For column handling, the appearance will be more like this:

VIEW STACK DUMP as of 11:34
  An optional message
    [0]: (V) { 0 320 } testView1
    [1]: (V) { 320 400 } testView2
    [2]: (V) { 720 320 } testView3 =CURRENT=
END VIEW STACK

The optional message parameter allows you to insert your own message to make searching the logs easier when debugging.

From left to right, the contents of the output mean the following:

  1. View Index, or, position on the view stack.
  2. Visibility Indicator. (V) indicates that the view is visible (though perhaps off-screen), and (H) indicates that the view is hidden.
  3. Positional Indicator. The first number within the braces indicates the left pixel position of the view, and is only applicable when dealing with column-based view handling. The second number indicates the reported maximum width of the view (which is used to calculate the next view's left pixel position), and again is only applicable when dealing with column-based view handling.
  4. View ID.
  5. Current Indicator. If =CURRENT= is displayed, the view is considered to be the "current" view. This means that it is typically equal to the value of PKUI.CORE.currentView and is at the top of the stack. It is the view that will be popped should PKUI.CORE.popView be called.

Example:

PKUI.CORE.dumpViewStack ();
PKUI.CORE.dumpViewStack ( "A debugging message." );

Version

0.2 Introduced; Docs Valid

Clone this wiki locally