Source for file Stack.php
Documentation is available at Stack.php
require_once 'Gtk2/ExceptionDump/StackModel.php';
require_once 'Gtk2/VarDump.php';
require_once 'Gtk2/VarDump/ColTreeView.php';
* Stack trace list for an exception.
* Tree with the trace lines in top level, and the parameters
* Double-click an entry, and Gtk2_VarDump will be started.
* Drop an entry in your editor to open the file.
* @package Gtk2_ExceptionDump
* @author Christian Weiske <cweiske@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
* @link http://pear.php.net/package/Gtk2_ExceptionDump
* Creates the stack trace list.
* @param mixed $exception Exception or PEAR_Error
if ($exception !== null ) {
* Sets up the columns and DnD thingies.
protected function build()
$this->createColumns (array ('#', 'Function', 'Location'));
$this->connect_after ('event', array ($this, 'clickedTree'));
$this->set_events (Gdk ::_2BUTTON_PRESS );
Gdk ::ACTION_COPY | Gdk ::ACTION_MOVE
$this->drag_source_add_uri_targets ();
$this->connect ('drag-begin' , array ($this, 'onDragBegin'));
$this->connect ('drag-data-get', array ($this, 'onGetDragData'));
* Sets and displays the exception.
* @param mixed $exception Exception or PEAR_Error
* @param int $nOmitLines Number of stack lines to supress
$this->get_model ()->setException ($exception, $nOmitLines);
}//public function setException($exception, $nOmitLines = 0)
* The tree has been double-clicked. This causes Gtk2_VarDump
* to be opened with the selected stack trace entry.
* @param GtkTreeView $tree The tree which has been clicked
* @param GdkEvent $event The event data for the click event
if ($event->type !== Gdk ::_2BUTTON_PRESS ) {
list ($model, $arSelected) = $tree->get_selection ()->get_selected_rows ();
if ($arSelected === null ) {
$path = implode(':', $arSelected[0 ]);
if ($event->button == 1 ) {
$iter = $this->get_model ()->get_iter ($path);
$var = $this->get_model ()->get_value ($iter, 3 );
Gtk2_VarDump ::display ($var, $this->get_model ()->get_value ($iter, 1 ));
}//public function clickedTree($tree, $event)
* Returns the data at the end of a DnD operation
* that shall go into the target application.
* @param GtkWidget $widget Widget the drag begin with
* @param mixed $context Drag context object
* @param GtkSelection $selection Selection object
* @param mixed $info Info object
* @param int $time Time the drag started
public function onGetDragData($widget, $context, $selection, $info, $time)
list ($model, $iter) = $widget->get_selection ()->get_selected ();
$context->drag_abort ($time);
$step = $model->get_value ($iter, 3 );
$file = $step['file'] . "\r\n";
Gdk ::atom_intern ('text/uri-list'),
//gint format, format (number of bits in a unit)
//const guchar *data,pointer to the data (will be copied)
//gint length, length of the data
}//function onGetDragData($widget, $context, $selection, $info, $time)
* When a drag begins, we want to set DnD icon to reflect
* the contents of the row being dragged.
* @param GtkWidget $widget Widget the drag begin with
* @param mixed $context Drag context object
list ($model, $iter) = $this->get_selection ()->get_selected ();
$context->drag_abort ($time);
$this->drag_source_set_icon(
GdkColormap::get_system(),
//FIXME: create pixmap with contents that really will be dropped
$this->create_row_drag_icon(
$this->get_model()->get_path($iter)
}//public function onDragBegin($widget, $context)
}//class Gtk2_ExceptionDump_Stack extends Gtk2_VarDump_ColTreeView
Documentation generated on Mon, 11 Mar 2019 15:55:05 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|