content = $content; // Init markup label $this->gtk = new GtkLabel; $this->gtk->set_use_markup( true ); $this->gtk->set_selectable( true ); $this->gtk->set_track_visited_links( true ); $this->gtk->set_xalign( 0 ); $this->gtk->set_yalign( 0 ); $this->gtk->show(); // Init events $this->gtk->connect( 'activate-link', function( GtkLabel $label, string $href ) { return $this->_onActivateLink( $label, $href ); } ); $this->gtk->connect( 'button-press-event', function( GtkLabel $label, GdkEvent $event ) { return $this->_onButtonPress( $label, $event ); } ); $this->gtk->connect( 'configure-event', function( GtkWindow $window, GdkEvent $event ) { return $this->_onConfigure( $label, $event ); } ); } protected function _onActivateLink( GtkLabel $label, string $href ): bool { return false; } protected function _onButtonPress( GtkLabel $label, GdkEvent $event ): bool { return false; } abstract protected function _onConfigure( GtkLabel $label, GdkEvent $event ): bool; abstract public function set( string $value ): void; }