MK wrote:
Amazingly, what worked in the end was simply adding
-state=> 'disabled'
into the actual $menu->command, hence avoiding the documented
"entryconfigure" method or cget altogether
but if anyone has any patience left could you explain:
my $state = ($count++ & 1) ? 'normal' : 'disabled';
to me, specifically the "& 1) ? 'x' : 'y'" segment?
"my $state = 'normal';" if the value of $count is an odd number or "my
$state = 'disabled';" if the value of $count is an even number and then
after the test increment the value of $count. "& 1" tests the least
significant bit of $count, it is more efficient then the modulo test "%
2", another way to test even or odd numbers.
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/