Example #1
0
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkFrame();
     parent::add($this->widget);
     $this->container = new GtkVBox();
     $this->initialItems = array();
     $this->items = array();
     $targets = array(array('text/plain', 0, -1));
     $this->widget->connect('drag_data_received', array($this, 'onDataReceived'));
     $this->widget->drag_dest_set(Gtk::DEST_DEFAULT_ALL, $targets, Gdk::ACTION_COPY);
     $scroll = new GtkScrolledWindow();
     $scroll->set_border_width(4);
     $this->widget->add($scroll);
     $hbox = new GtkHBox();
     $scroll->add_with_viewport($hbox);
     $hbox->pack_start($this->container, TRUE, TRUE);
     $hbox->set_border_width(20);
     parent::show_all();
 }
Example #2
0
 /**
  * Class Constructor
  * @param  $name widget's name
  */
 function __construct($name)
 {
     parent::__construct($name);
     $this->widget = new GtkScrolledWindow();
     $this->widget->set_policy(GTK::POLICY_AUTOMATIC, GTK::POLICY_ALWAYS);
     parent::add($this->widget);
     $this->tree = new GtkTreeView();
     $this->tree->connect_simple('select-cursor-row', array($this, 'onPreExecuteExitAction'));
     $this->tree->connect_simple('button-press-event', array($this, 'onPreExecuteExitAction'));
     $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING);
     $this->tree->set_model($this->model);
     $this->tree->set_headers_visible(FALSE);
     $this->tree->set_rubber_banding(TRUE);
     $this->tree->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE);
     $column = new GtkTreeViewColumn();
     $cell_renderer = new GtkCellRendererText();
     $column->pack_start($cell_renderer, true);
     $column->add_attribute($cell_renderer, 'text', 1);
     $this->tree->append_column($column);
     $this->widget->add($this->tree);
     parent::show_all();
 }
Example #3
0
 /**
  * Show the widget at the screen
  */
 public function show()
 {
     if (!$this->created) {
         $this->createModel();
     }
     $this->table_fields->show();
     parent::show_all();
 }