roho has asked for the wisdom of the Perl Monks concerning the following question:
The basic menu contains default settings (for example: "View->Wrap->Character"). How do I change default settings in the basic menu? I need the basic menu default to be "View->Wrap->Word".
TIA for any help you can provide.
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::Menu; use Tk::More; use Tk::NoteBook; my $mw = new MainWindow; $mw->geometry("100x100+0+0"); my $bw = $mw->Toplevel(); $bw->geometry("400x200"); my $book = $bw->NoteBook()->pack( -fill=>'both', -expand=>1 ); my $tab = $book->add( "Sheet 1", -label=>"Tab #1" ); my $more = $tab->Scrolled("More", -scrollbars => "osoe",)->pack(-fill +=> "both", -expand => 1); ##################################### # Add basic menu to Toplevel window. ##################################### my $menu = $more->menu; $bw->configure(-menu => $menu); MainLoop;
"It's not how hard you work, it's how much you get done."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to Change Defaults in Basic Tk Menu
by choroba (Cardinal) on Aug 29, 2020 at 22:20 UTC | |
by haj (Vicar) on Aug 30, 2020 at 00:08 UTC | |
by roho (Bishop) on Aug 30, 2020 at 04:57 UTC | |
by roho (Bishop) on Aug 29, 2020 at 23:29 UTC | |
by choroba (Cardinal) on Aug 30, 2020 at 14:01 UTC |