$textfield_listing->bind('<>', sub { if ($textfield_listing->curselection()) { $button_stop->configure( -state => "normal"); $button_log->configure( -state => "normal"); $button_info->configure( -state => "normal"); } } ); $textfield_listing->bind('<>', sub { $button_stop->configure( -state => "disabled"); $button_log->configure( -state => "disabled"); $button_info->configure( -state => "disabled"); } );