spencoid has asked for the wisdom of the Perl Monks concerning the following question:
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();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: adding style
by spencoid (Acolyte) on Jun 12, 2018 at 01:44 UTC | |
by kcott (Archbishop) on Jun 12, 2018 at 09:00 UTC |
Back to
Seekers of Perl Wisdom