page = $page; // Init container $this->gtk = new \GtkLabel( $this->_value ); $this->gtk->set_width_chars( $this->_length ); $this->gtk->set_ellipsize( $this->_ellipsize ); } public function set( ?string $value = null, ?string $subtitle = null, ?string $tooltip = null ): void { $this->setValue( $value ); $this->setSubtitle( $subtitle ); $this->setTooltip( is_null($tooltip) ? (mb_strlen(strval($value)) > $this->_length ? $value : null) : $tooltip ); } public function setValue( ?string $value = null ): void { $this->gtk->set_text( is_null($value) ? _($this->_value) : trim( $value ) ); } public function setSubtitle( ?string $subtitle = null ): void { $this->subtitle = is_null($subtitle) ? _($this->_subtitle) : strtolower( trim( $subtitle ) ); } public function setTooltip( ?string $tooltip = null ): void { $this->gtk->set_tooltip_text( is_null($tooltip) ? _($this->_tooltip) : trim( $tooltip ) ); } public function getValue(): ?string { return $this->gtk->get_text(); } public function getSubtitle(): ?string { return $this->subtitle; } public function getTooltip(): ?string { return $this->gtk->get_tooltip(); } }