Home > front end >  Perl Tk Formatting Text in a button
Perl Tk Formatting Text in a button

Time:03-06

The code below creates Perl/Tk buttons filled with each event's details from the hash %events. 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.

use strict;
use Tk;

my %events;
$events{"Jazz Fest"}{city}   = "New Orleans";
$events{"Jazz Fest"}{state}   = "LA";
$events{"Jazz Fest"}{date}   = "June 6th, 2023";
$events{"Lollapalooza"}{city}   = "Chicago";
$events{"Lollapalooza"}{state}   = "IL";
$events{"Lollapalooza"}{date}   = "July 25th, 2023";
$events{"Blues Fest"}{city}   = "Chicago";
$events{"Blues Fest"}{state}   = "IL";
$events{"Blues Fest"}{date}   = "Augsut 4th, 2023";

my            
  • Related