memory = new \Yggverse\Yoda\Model\History(); $this->navbar = $navbar; $this->gtk = new \GtkButtonBox( \GtkOrientation::HORIZONTAL ); $this->gtk->set_layout( \GtkButtonBoxStyle::EXPAND ); $this->back = new Back( $this->navbar ); $this->gtk->add( $this->back->gtk ); $this->forward = new Forward( $this->navbar ); $this->gtk->add( $this->forward->gtk ); } public function add( string $value ): void { if (empty($value)) { throw new \Exception; } if ($value != $this->memory->getCurrent()) { $this->memory->add( $value ); } $this->refresh(); } public function refresh(): void { $this->back->refresh(); $this->forward->refresh(); } }