apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Gtk2_VarDump

Source Location: /Gtk2_VarDump-1.0.0/VarDump.php

Class Overview

GtkWindow
   |
   --Gtk2_VarDump

Simple class for viewing PHP variables a var_dump() way in PHP-Gtk - reloaded for PHP-Gtk2.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 45]
Simple class for viewing PHP variables a var_dump() way in PHP-Gtk - reloaded for PHP-Gtk2.

It displays arrays and objects in a tree with all their children and subchildren and subsubchildren and ...

The class is memory-saving as it loads only the children which are currently visible. If the user expands a row, the next children will be loaded.

The tree has a small convenience feature: Left-click a row, and it will be expanded. Right-click it, and it collapses. Double-click or middle-click it, and all rows below the current one will be expanded. They will be expanded "all" only if they have been expanded before, as loading them recursively is very dangerous (if there are loops).

Note that Gtk2_VarDump::display() opens its own Gtk::main()-Loop, so your own program will stop executing until the VarDump window is closed.

Usage: require_once('Gtk2/VarDump.php'); $ar = new array(1, 2, 3, 4, 'key' => array('this','is','cool'); Gtk2_VarDump::display($ar);

Layout: +--[Window title]------------------------------------------------+ |+--------------------------+/+---------------------------------+| || Node | Type ^\| Key | Type | Value ^| || |/| || || Left tree with objects |\| Right list with simple values || || and arrays |/| (int,float,string,...) || || v\| v| |+--------------------------+/+---------------------------------+| | [OK] | +----------------------------------------------------------------+



[ Top ]


Class Variables

$modTree =  null

[line 63]

Model (data store) for the tree on the left.
  • Access: protected

Type:   GtkTreeStore


[ Top ]

$modValues =  null

[line 69]

Model (data store) for the list on the right.
  • Access: protected

Type:   GtkListStore


[ Top ]

$trTree =  null

[line 51]

The tree on the left side of the window.
  • Access: protected

Type:   GtkTreeView


[ Top ]

$trValues =  null

[line 57]

List on the right side of the window.
  • Access: protected

Type:   GtkTreeView


[ Top ]



Method Detail

__construct (Constructor)   [line 80]

Gtk2_VarDump __construct( mixed $variable, [string $title = 'Gtk2_VarDump'])

Create a new Gtk2_VarDump window.

When the window is closed, a main loop is stopped.

  • Access: public

Parameters:

mixed   $variable   —  The variable to inspect
string   $title   —  The title for the window and the variable

[ Top ]

buildDialog   [line 111]

void buildDialog( string $title)

Creates the dialog content, loads the tree models and so
  • Access: protected

Parameters:

string   $title   —  The title for the window

[ Top ]

close   [line 138]

void close( )

Called when the user clicks "OK" or tries to close the window.

This function quits the main loop opened in the constructor.

  • Access: public

[ Top ]

display   [line 97]

void display( mixed $variable, [string $title = 'Gtk2_VarDump'])

Create a new Gtk2_VarDump window and keep it displayed in its own Gtk::main()-loop.

This main loop is stopped as soon the window is closed

  • Access: public

Parameters:

mixed   $variable   —  The variable to inspect
string   $title   —  The title for the window and the variable

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:19:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.