in reply to Menubar checkbutton to show state?

I assume you use Perl Tk, in this case you can use a Tk::StatusBar widget for the task.

Here is a tiny patch to fix a problem, I encountered, regarding 'systembuttonface':

--- lib/Tk/StatusBar.pm 2004-02-05 05:21:14.000000000 +0200 +++ lib/Tk/StatusBar.pm.new 2010-03-29 12:58:51.164978272 +0300 @@ -147,7 +147,6 @@ my $n = $self->ProgressBar( -borderwidth => $borderwidth, -width => 17, - -troughcolor => 'systembuttonface', %args, );

Update: How would I do it: :)

use strict; use warnings; use Tk; use Tk::StatusBar; use Tk::ToolBar; my $mw = MainWindow->new; $mw->geometry('200x80+10+20'); $mw->optionAdd('*Label.font' => '{MS Sans Serif} 8'); my $tb = $mw->ToolBar(qw/-movable 1 -side top/); my $connected = 1; $tb->ToolButton( -image => 'actreload16', -tip => 'back', -command => \&toggle_conn, ); my $sb = $mw->StatusBar(); my $txtstatus = $sb->addLabel( -relief => 'flat' ); my $icostatus = $sb->addLabel( -width => 20, -relief => 'raised', -anchor => 'center', -side => 'right' ); toggle_conn(); MainLoop(); sub toggle_conn { if ($connected) { $connected = 0; my $text = 'Disconnected'; $icostatus->configure( -image => 'connectno16' ); $txtstatus->configure( -foreground => 'darkred', -textvariable => \$text, ); } else { $connected = 1; my $text = 'Connected'; $icostatus->configure( -image => 'connectyes16' ); $txtstatus->configure( -foreground => 'darkgreen', -textvariable => \$text, ); } }

Regards, Stefan