I have been using various versions of TK for 20 years or so. I recently started writing scripts by starting with an example I found online. I have finally figured out the syntax to get what I want with most widgets but using this version (or whatever it is) I can not figure out how to configure things like color and font on any of the widgets. I have searched online for answers and nothing seems to help. He is a minimal test case. I just want to be able to give buttons background color active color etc etc and to have control over font type and size.
use strict;
use Tkx;
my $tol = 1;
my $main_back_color = "#EDF8F8";
Tkx::wm_title(".", "OIML lookup");
Tkx::ttk__frame(".c", -padding => "8 2 1 1");
#.c->configure( -background => "$backcolor" );
#Tkx::ttk__frame(".c");
Tkx::grid( ".c", -column => 0, -row => 1, -sticky => "nwes");
Tkx::grid_columnconfigure( ".", 0, -weight => 1);
Tkx::grid_rowconfigure(".", 0, -weight => 1);
Tkx::ttk__button(".c.calc", -text => "Calculate", -command => sub {cal
+culate();});
Tkx::grid(".c.calc", -column => 0, -row => 0, -sticky => "W");
Tkx::ttk__button(".c.clear", -text => "Clear", -command => sub {clear(
+);});
Tkx::grid(".c.clear", -column => 1, -row => 0, -sticky => "W");
Tkx::ttk__button(".c.wiz", -text => "Wizzard", -command => sub {wizzar
+d();});
Tkx::grid(".c.wiz", -column => 2, -row => 0, -sticky => "E");
Tkx::ttk__radiobutton(".c.rb5", -text => '.00005"',-variable=> \$tol,
+-value=> 1);
Tkx::grid(".c.rb5", -column => 2, -row => 1, -sticky => "E");
Tkx::ttk__radiobutton(".c.rb6", -text => '.0001"',-variable=> \$tol, -
+value=> 2);
Tkx::grid(".c.rb6", -column => 3, -row => 1, -sticky => "w");
Tkx::MainLoop();
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.