auth = $auth; // Init GTK $this->gtk = new GtkRadioButton; $this->gtk->set_margin_top( $this::MARGIN ); $this->gtk->set_margin_start( $this::MARGIN ); $this->gtk->set_margin_end( $this::MARGIN ); $this->gtk->show(); // Connect events $this->gtk->connect( 'toggled', function(): void { $this->auth->refresh(); } ); } public function setGroup( Identity $identity ): void { $this->gtk->join_group( $identity->gtk ); } public function setLabel( int $id, ?string $label = null ): void { $this->gtk->set_label( $label ? sprintf( $this::LABEL_DEFAULT, $id, $label ) : sprintf( $this::LABEL_NO_NAME, $id ) ); } public function setName( string $label ): void { $this->name = new Identity\Name( $this ); } }