page = $page; // Init container $this->gtk = new \GtkBox( \GtkOrientation::HORIZONTAL ); $this->gtk->set_margin_top( $this->_margin ); $this->gtk->set_margin_bottom( $this->_margin ); $this->gtk->set_margin_start( $this->_margin ); $this->gtk->set_margin_end( $this->_margin ); $this->gtk->set_spacing( $this->_margin ); // Init query field $this->query = new Query( $this ); $this->gtk->pack_start( $this->query->gtk, true, true, 0 ); // Init send button $this->send = new Send( $this ); $this->gtk->add( $this->send->gtk ); // Hide widget by default $this->hide(); } public function show(): void { $this->gtk->show_all(); } public function hide(): void { $this->gtk->hide(); } public function refresh() { $this->query->refresh(); $this->send->refresh(); } public function send(): void { $address = new Address( $this->page->navbar->request->getValue() ); $address->setQuery( urlencode( trim( strval( $this->query->getValue() ) ) ) ); $this->page->open( $address->get(), false // disable history recording ); $this->hide(); } }