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

Source for file Pane.php

Documentation is available at Pane.php

  1. <?php
  2. require_once 'Gtk2/VarDump/Tree.php';
  3. require_once 'Gtk2/VarDump/List.php';
  4.  
  5. /**
  6. *   Pane that holds both tree and list views.
  7. *
  8. *   @author Christian Weiske <cweiske@php.net>
  9. */
  10. class Gtk2_VarDump_Pane extends GtkHPaned
  11. {
  12.     public function __construct()
  13.     {
  14.         parent::__construct();
  15.         $this->build();
  16.     }//public function __construct()
  17.  
  18.  
  19.  
  20.     /**
  21.     *   Create the GUI and set up all the things
  22.     */
  23.     protected function build()
  24.     {
  25.         $this->trTree = new Gtk2_VarDump_Tree();
  26.         $this->trList = new Gtk2_VarDump_List();
  27.  
  28.         $this->trTree->setList($this->trList);
  29.  
  30.         $this->set_position(250);
  31.  
  32.         $scrwndTree = new GtkScrolledWindow();
  33.         $scrwndList = new GtkScrolledWindow();
  34.         $scrwndTree->set_policy(Gtk::POLICY_AUTOMATICGtk::POLICY_AUTOMATIC);
  35.         $scrwndList->set_policy(Gtk::POLICY_AUTOMATICGtk::POLICY_AUTOMATIC);
  36.         $scrwndTree->add($this->trTree);
  37.         $scrwndList->add($this->trList);
  38.  
  39.         $this->add1($scrwndTree);
  40.         $this->add2($scrwndList);
  41.     }//protected function build()
  42.  
  43.  
  44.  
  45.     /**
  46.     *   Set the variable (and their name) to display.
  47.     *
  48.     *   @param mixed  $variable   Variable to display
  49.     *   @param string $name       Name of the variable
  50.     */
  51.     public function setVariable($variable$name '')
  52.     {
  53.         $this->trTree->setVariable($variable$name);
  54.         if (gettype($variable!== 'array' && gettype($variable!== 'object'{
  55.             $this->set_position(0);
  56.         }
  57.     }//public function setVariable($variable, $name = '')
  58.  
  59. }//class Gtk2_VarDump_Pane extends GtkHPaned
  60. ?>

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