CColin has asked for the wisdom of the Perl Monks concerning the following question:
Have just started using Perl Tk and am creating a compound button widget. Am pretty much adapting the compound button creation example from "Mastering Perl Tk" as follows:
my $bttn = $mw->Button; my $c = $bttn->Compound; $c->Space(-height => 10); $c->Line; $c->Space(-width => 10); $c->Text(-text => "A name", -font => 'times 19'); $c->Image(-image => $bttn->Photo(-file => "an_image.png") ); $c->Space(-width => 10); $c->Line; $c->Space(-height => 10);
This code is run within a loop of names/ images and does indeed spit out a list of buttons that represent what is required - however I'd like to align all the image files to the right of each button and fix the button widths so that they appear visually aligned as if in a vertical column. (Clearly the text for "A name" is of variable length, which explains why they are not currently aligned but ragged).
I'm reading docs without much luck. Any ideas how to do this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Tk compound formatting
by thundergnat (Deacon) on Jun 06, 2013 at 18:13 UTC | |
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 |