title: Perl Tk Formatting Text in a button
body: <p>The code below creates <code>Perl/Tk</code> buttons filled with each event's details from the hash <code>%events</code>. Is there a way to format the text inside the buttons so that it appears in aligned columns in the manner printf prints it out on line 16.</p>
  <pre><code>use strict;
  use Tk;
  
  my %events;
  $events{&quot;Jazz Fest&quot;}{city}   = &quot;New Orleans&quot;;
  $events{&quot;Jazz Fest&quot;}{state}   = &quot;LA&quot;;
  $events{&quot;Jazz Fest&quot;}{date}   = &quot;June 6th, 2023&quot;;
  $events{&quot;Lollapalooza&quot;}{city}   = &quot;Chicago&quot;;
  $events{&quot;Lollapalooza&quot;}{state}   = &quot;IL&quot;;
  $events{&quot;Lollapalooza&quot;}{date}   = &quot;July 25th, 2023&quot;;
  $events{&quot;Blues Fest&quot;}{city}   = &quot;Chicago&quot;;
  $events{&quot;Blues Fest&quot;}{state}   = &quot;IL&quot;;
  $events{&quot;Blues Fest&quot;}{date}   = &quot;Augsut 4th, 2023&quot;;
  
  my %data;
  foreach my $event (sort keys %events) {
  
      printf(&quot;%-15.15s %-20.20s %-2.2s %18.18s\n&quot;, $event, $events{$event}{city}, $events{$event}{state}, $events{$event}{date});
      $data{$event} = sprintf(&quot;%-15.15s %-20.20s %-2.2s %18.18s&quot;, $event, $events{$event}{city}, $events{$event}{state}, $events{$event}{date});
      
  }
  
  my $data;
  
  my $mw = MainWindow-&gt;new;
  $mw-&gt;title(&quot;Event Clipboard Copy&quot;);
  $mw-&gt;label(&quot;Pick Event Details to Copy.&quot;);
  
  for(sort keys %data){
  
      my $text = $data{$_};
      $mw-&gt;Button( -text =&gt; $text, -anchor =&gt; 'w', -command =&gt; sub  {
      
      Clipboard-&gt;copy( $text );
           
          }
      )-&gt;pack( -fill =&gt; 'x' );
  }
  
  MainLoop;
  </code></pre>