Dear Monks,

I am trying to justify cascade entries within a menubar but every option I try does not seem to work and its driving me nuts.

I've tried packing each cascade and although this is accepted it has no effect. All the cascades are justified to the left regardless. I have previously used menubuttons directly on a normal frame and this allows justification of the buttons on the frame but I lose the automatic navigation (Alt+F etc) managed when using cascades.

Am I just being greedy and in fact I need to settle on one or the other?

Any help would be greatly appreciated.

Here is the code snippet procedure sub that defines the menu and cascades...

#--------------------------------------------------------------------- +-------------- #-- Define menubar sub Define_Menu { $Menu_Frame = $TopWindow->Frame(-relief => 'raised', -borderwidth = +> 2)->form(-top=>'%0',-left=>'%0',-right=>'%100'); $Menu_Toplevel = $Menu_Frame->toplevel ; $Menu_Bar = $Menu_Toplevel->Menu(-type => 'menubar') ; $Menu_Toplevel->configure(-menu => $Menu_Bar) ; $Menu_File = $Menu_Bar->cascade(-label=> '~File', -tearoff => 0); $Menu_File_Select = $Menu_File->command (-label => 'Select ~M +ySQL Dump File...', -command => \&Select_C +onfig_Root, -accelerator => 'Control+c +') ; $Menu_File->separator ; $Menu_File_Exit = $Menu_File->command (-label => '~Exit', -command => \&Abandon, -accelerator => 'Control+x') + ; $Menu_File->pack(-side=>'left',-anchor=>'nw') ; $Menu_Run = $Menu_Bar->cascade(-label=> '~Run', -tearoff => 0 ); $Menu_Run_Split = $Menu_Run->command (-label => '~Split', -command => \&Split , -accelerator => 'Control+q'); $Menu_Help = $Menu_Bar->cascade(-label=> '~Help', -tearoff => 0 ) ; $Menu_Help_Help = $Menu_Help->command (-label => '~Help', -command => [\&ShowHelpMess +age], -accelerator => 'Control+h') + ; $Menu_Help_About = $Menu_Help->command (-label => '~About', -command => [\&ShowAboutMe +ssage,$ver], -accelerator => 'Control+a' +) ; $Menu_Help->pack(-side=>'right',-anchor=>'ne') ; ; $Menu_Run_Split->configure(-state => 'disabled'); }

In reply to Perl/TK Menubar can't justify cascades by bearslumber

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.