ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-tk
perl-tk
left justifying radiobuttons
by Listmail other posts by this author
Dec 30 2005 9:28AM messages near this date
Re: Change scrollbar/scale slider image ? | Re: left justifying radiobuttons
SOURCE # Need help left justifying both the radiobuttons and the text for each 
column (frame) inside the Dialog.
# Is it possible?  Right now it appears to be centering the radiobuttons 
and text within each column.

use strict;
use warnings;
use Tk;
use Tk::Dialog;

my 
@selections=('one','two','three','four','five','six','seven','eight','nine','ten');
my $selected;

my $selector = MainWindow-> new(-title=> "Select Test");

$selector-> Dialog(-title => "Select",
                  -buttons =>  ['Ok','Cancel'],
                  -default_button =>  'Ok');

my $sframe1=$selector-> Frame()->pack(-side=>'left');
my $sframe2=$selector-> Frame()->pack(-side=>'right');

my $x=1;

foreach my $selection (@selections) {
                        if ($x < 6) {
                                    $sframe1-> Radiobutton(-text => 
"$selection"
                                                          ,-variable =>  
\$selected
                                                          ,-value =>  
"$selection"
                                                          , -justify=> 'left'
                                                         )-> pack(-side 
=>  'top');
                        } else {
                                    $sframe2-> Radiobutton(-text => 
"$selection"
                                                          ,-variable =>  
\$selected
                                                          ,-value =>  
"$selection"
                                                          ,-justify =>  
'left'
                                                         )-> pack(-side 
=>  'top');
                        }
                        $x++
}

MainLoop();
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
Thread:
Listmail
Marc Dashevsky
IvorW

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved