Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^7: How do I space out each radio button horizontally in Perl/Tk

by stefbv (Curate)
on Jul 11, 2014 at 07:24 UTC ( [id://1093196]=note: print w/replies, xml ) Need Help??


in reply to Re^6: How do I space out each radio button horizontally in Perl/Tk
in thread How do I space out each radio button horizontally in Perl/Tk

Make a new Frame for the radio buttons, and use grid to add it to the page.

my $rb_frm = $mwt_pckg->Frame()->grid( -sticky => 'w', -column => 1, -row => 2, -columnspan => 20, -padx => 50, ); my $package = 'normal'; foreach my $type (qw(normal pckg_A pckg_B)) { $rb_frm->Radiobutton( -text => " $type", -value => $type, -variable => \$package, -command => sub { say $package; }, )->pack; }
  • Comment on Re^7: How do I space out each radio button horizontally in Perl/Tk
  • Download Code

Replies are listed 'Best First'.
Re^8: How do I space out each radio button horizontally in Perl/Tk
by Janish (Sexton) on Jul 11, 2014 at 08:38 UTC

    Thanks a bunch stefbv (your " Make a new Frame for the radio buttons" do the trick :)) and those all who contributed your ideas. I finally able to get what I looks for with slightly modification of stefbv sample code, to make the radio button horizontal, posted it here for reference for those who need help as me. It looks like below:-

    my $rb_frm = $mwt_pckg->Frame()->grid( -sticky => 'w', -column => 1, -row => 2, # -columnspan => 20, # -padx => 50, ); my $package = 'normal'; foreach my $type (qw(normal pckg_A pckg_B)) { $rb_frm->Radiobutton( -text => " $type", -value => $type, -variable => \$package, -command => sub { say $package; }, )->pack (-side => 'left'); #This line to make it horizontal }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1093196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-18 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found