label($label); } public function title($value = false) { parent::title(''); } public function label($value = false) { if( $value === false ) { return $this->label; } else { if( $this->active() ) { $this->attribute_on( NCURSES_A_REVERSE ); } $this->write_centered(floor($this->height() / 2), $value); $this->attribute_off(NCURSES_A_REVERSE); $this->label = $value; } } public function click() { $this->emit('clicked'); } public function focus() { parent::focus(); $this->label($this->label); } public function blur() { parent::blur(); $this->label($this->label); } public function on_key_press($key) { switch( $key ) { case 13: // RETURN $this->click(); break; default: parent::on_key_press($key); } } } ?>