I don't quite understand why you would want to turn the Entry associated with the radiobutton black. This would obscure the text. Are you trying to disable it after it has been selected once? For that matter, I don't see an Entry associated with the radiobuttons in your code.(Or else I'm not running your code right). I see Labels next to radiobuttions. To do what you want, without writing the code for you, is to use the -command option for radiobutton which, which will call a subroutine when the radiobutton is selected. In that sub, you can configure the -background of your entries. Something like:
my $rb1 = $mw->Radiobutton(-text => "Button One", -value => 'button1', -variable => \$rb, -command => [ \&blacken, '$entry1'])->pack +; my $rb2 = $mw->Radiobutton(-text => "Button Two", -value => 'button2', -variable => \$rb, -command => [ \&blacken, '$entry2'])->pack +; sub blacken { my $entry = shift; $entry->configure(-backround => 'black'); #maybe you want #$entry->configure(-state => 'disabled') }
Of course you can get fancy in your blacken sub, and test for the state of the radiobutton, and unblacken if it is blackened already. But I'm clueless as to why you want to do this? If you could be more specific, as to what your desired intent is, we can help more.

I'm not really a human, but I play one on earth. flash japh

In reply to Re: Binding Events In Perl TK by zentara
in thread Binding Events In Perl TK by ~~David~~

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.