Your options seem to be either to supply your own images for the checked and unchecked checkboxes to Checkbutton or use a different checkbutton object. I found Tk::Checkbox has the option of setting the size. I don't see how to add text next to it so you likely will need to add your own label.
use warnings;
use strict;
use Tk;
use Tk::Checkbox;
my $mw = MainWindow->new(-title => 'CheckBox size');
my $f = $mw->Frame->pack(-side => 'top');
my $weight1 = "normal";
my $fch = $f->Checkbutton(
-text => "Weight",
-variable => \$weight1,
)->pack(-side => 'left');
my $size = 16;
$fch->configure(-font => [ -size => $size ]);
my $weight2 = "Weight";
my $fch2 = $f->Checkbox(
-variable => \$weight2,
-command => sub {print "$weight2\n"},
-onvalue => "Weight",
-offvalue => "Mass",
-size => 25,
)->pack(-side => 'left');
MainLoop;
I found it was tricky to install Tk::Checkbox in CPAN since install Tk::Checkbox doesn't work and i /Tk::Checkbox/ doesn't find anything. I had to use install MIKRA/Tk-MK-0.23.tar.gz.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|