Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


In reply to Re: Tk - Tick box size change by Lotus1
in thread Tk - Tick box size change by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found