I created a table that contains a "Key" column, "Value" column and a "New Value" column as shown in the image below. The "Key" and "Value" columns are implemented as Labels, the "Value" column is wrapped as you can see. The "New Value" column is implemented as an Entry widget because it should be editable. There is a Copy & Paste button that copies the value to the "New Value" Entry field. I would like to wrap the text in the Entry widget, so after pressing the button it will look like the text in the "Value" field.
Here is the piece of code that defines the shown columns:
my $key_label = $table->Label(-text => $key , -width => 50, -bg => $background_color, -anchor => 'w', -relief => $relief_style, -wraplength => 300)->pack(-side => 'left');
$table->put($curr_row,1,$key_label);
my $orig_val_label = $table->Label(-text => $full_cfg_hash{$key}{'old_value'}, -width => 50, -bg => $background_color, -anchor => 'w', -relief => $relief_style, -wraplength => 300)->pack(-side => 'left');
$table->put($curr_row,2,$orig_val_label);
my $new_val_entry = $table->Entry(-text => $full_cfg_hash{$key}{'new_value'}, -width => $entry_size, -bg => $background_color)->pack( -side => 'left', -fill => 'both', -expand => 'yes');
$table->put($curr_row,3,$new_val_entry);
my $copy_paste_btn = $table->Button(-text => "Copy & Edit\nOld Value", -command => [\©_n_edit_old_value,$full_cfg_hash{$key}{'old_value'},$new_val_entry], -bg => $buttons_background, -foreground => $buttons_text_color)->pack(-side => 'left', -padx => 5);
$table->put($curr_row,4,$copy_paste_btn);
The Tk::Text widget is for multi-line text entry, usually combined with Tk::Scrolled, something like: