in reply to Perl Tk compound formatting
Something like this perhaps? (using built in bitmaps in lieu of png images)
use strict; use warnings; use Tk; my %w; $w{mw} = MainWindow->new; for (qw/ this that a_longer_name X /){ my $bttn = $w{mw}->Button( -text => "$_ ", -font => 'times 19', -justify => 'right', -compound => 'right', -bitmap => 'warning', #-image => $w{mw}->Photo( -file => 'whatever' ), -anchor => 'e', -padx => 4, )->pack; push @{$w{buttons}}, $bttn; } $w{mw}->update; { my $width = 0; for (@{$w{buttons}}) { $width = $_->width if $_->width > $width; } for (@{$w{buttons}}) { $_->configure( -width => $width ); } } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Tk compound formatting
by CColin (Scribe) on Jun 06, 2013 at 23:09 UTC | |
by Anonymous Monk on Jun 06, 2013 at 23:21 UTC | |
by thundergnat (Deacon) on Jun 07, 2013 at 12:32 UTC | |
by CColin (Scribe) on Jun 07, 2013 at 17:25 UTC |