in reply to Finding the height of a menubar
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; my $menubar = $mw->Menu(-type => 'menubar'); $mw->configure(-menu => $menubar); my $menu = $menubar->cascade(-label => '~File'); $menu->command(-label => '~New'); $menu->command(-label => '~Open'); $mw->Button(-text => 'Push me', -command => sub{ print "Reqheight:", $menubar->reqheight, " Reqwidth:", $menubar->reqw +idth, "\n"; } )->pack; MainLoop;
|
|---|