#!/usr/bin/perl -s use Tk; use Tk::ToolBar; use Tk::Compound; use strict; my $mw = MainWindow->new(); #Load images from Tk::ToolBar. my $tb = $mw->ToolBar(); $tb->destroy(); my $compound = $mw->Compound; $compound->Image( -image => 'acthelp16', -anchor => 'w' ); $compound->Space( -width => 8 ); $compound->Text( -text => "Open", -underline => 0 ); $compound->Space( -width => 28 ); my $menubar = $mw->Menu( -type => 'menubar', ); my $c2 = $mw->Compound; $c2->Space(-width => 40); $menubar->cascade( -label => 'File', -tearoff => 0, -menuitems => [ #Problem 1: Image is now shown properply before we #hoover over menuitem. [ Command => 'Open', -image => $compound, -hidemargin => 1, ], '-', #Problem2: When we are using hidemargin, the "hook" #of the checkbutton doesn't appear anymore. [ Checkbutton => 'Checkthing', -hidemargin => 1, -image=>$c2, -compound=>'left', ], ] ); $mw->configure( -menu => $menubar ); MainLoop;