in reply to Menubar checkbutton to show state?
#!/usr/bin/perl use Tk; use strict; my $mw = MainWindow->new; $mw->geometry('20x20-20-20'); $mw->overrideredirect(1); # make right mouse button click an exit $mw->bind( '<3>' => sub{ exit } ); my @color = qw/red lightgray/; my $bits = pack("b8"x8, "...11...", "..1111..", ".111111.", "11111111", "11111111", ".111111.", "..1111..", "...11...",); $mw->DefineBitmap('indicator' => 8,8, $bits); my $label = $mw->Label(-bitmap=>'indicator', -fg=>'red', -bg => 'black +') ->pack( -fill=>'both', -expand=>1); $mw->repeat(500,sub{$label->configure( -fg=>$color[0]); @color=reverse(@color); }); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Menubar checkbutton to show state?
by swe9 (Initiate) on Aug 19, 2010 at 19:58 UTC |