<HTML>
<HEAD><TITLE> 9.17. How do I obtain Menus that do not tear off?</TITLE></HEAD>
<BODY><a name="A9.17"> 9.17. How do I obtain <kbd>Menu</kbd>s that do not tear off?</a>
<hr>
</p><p>
<a href="mailto:nik@tiuk.ti.com">Nick Ing-Simmons</a> outlined a couple of ways
to achieve this result. The critical feature being the
<kbd>-tearoff => 0</kbd> configuration option of the <kbd>Menu</kbd>.
In <a href="mailto:nik@tiuk.ti.com">Nick's</a> words:
<PRE>
my $mb = $parent->Menubutton(...); # The button
my $menu = $mb->Menu(-tearoff => 0); # Create a non-tearoff menu
$mb->configure(-menu => $menu); # Tell button to use it.
$mb->command(....);
</PRE><BLOCKQUOTE>
Above is for clarity - you can loose <kbd>$menu</kbd> variable:
</BLOCKQUOTE><PRE>
my $mb = $parent->Menubutton(...);
$mb->configure(-menu => $mb->Menu(-tearoff => 0));
$mb->command(....);
</PRE>
<hr>
<p><a href="qna9.16.html">Previous</a> | Return to <a href="ptkTOC.html#TOC9.17">table of contents</a> | <a href="qna10.html">Next</a>
</p><hr><p>
</BODY></HTML>