cascade menu 
Author Message
 cascade menu

Hi,

Can someone send me an example how to create a cascade menu within a
menubar.

I could not find any examples on the internet.

Thanks.
--
        Arnold van Keersop      




Tue, 10 Jul 2001 03:00:00 GMT  
 cascade menu

Quote:
> Hi,
> Can someone send me an example how to create a cascade menu within a
> menubar.
> I could not find any examples on the internet.

my $mw = MainWindow->new;
$mw->geometry('300x50');
my $menubar = $mw->Menu;
$mw->configure(-menu => $menubar);

my $file = $menubar->cascade(-label => '~File');
my $cas1 = $menubar->cascade(-label => 'Cas~cades');
my $help = $menubar->cascade(-label => '~Help');

$file->command(-label => "Quit!", -command => \&exit);

# Here we have four levels of cascades.

my $cas2 = $cas1->cascade(-label => "Cascade Level 2");;
my $cas3 = $cas2->cascade(-label => 'Cascade Level 3');
my $cas4 = $cas3->cascade(-label => 'Cascade Level 4');

$cas1->command(-label => 'Level 1', -command => sub {print "Level 1\n"});
$cas2->command(-label => 'Level 2', -command => sub {print "Level 2\n"});
$cas3->command(-label => 'Level 3', -command => sub {print "Level 3\n"});
$cas4->command(-label => 'Level 4', -command => sub {print "Level 4\n"});

$help->command(-label => 'Version');
$help->separator;
$help->command(-label => 'About');



Tue, 10 Jul 2001 03:00:00 GMT  
 cascade menu

Quote:

> Hi,

> Can someone send me an example how to create a cascade menu within a
> menubar.

> I could not find any examples on the internet.

Look at the menu examples of the widget demonstration. On my system,
the source files are in

  /usr/local/lib/perl5/site_perl/Tk/demos/widget_lib/menus.pl
  /usr/local/lib/perl5/site_perl/Tk/demos/widget_lib/menus2.pl

On your system, it's probably on a different location.

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas->pack;$x=45;for(split/_/,'KPI1_+09IPK_K;-OA1_+K!;A__1;
Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+KN._K+1Q!.F_1+KN.Q_+1Q__+1!
KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q'){s/\n//g;for(split/!/){$c->create(
'line',map{$a=-43+ord;($x+($a>>3)*2,123+($a&7)*2)}split//)}$x+=12}MainLoop



Tue, 10 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. menu options not propagated to cascade menus?

2. Cascading Menus

3. help with cascaded menus and stuff...

4. referencing items on cascade menu?

5. problems with cascade menu

6. Multi level cascaded menus?

7. Cascade Menus

8. Cascading menu not responding to mouse...?? Code included

9. Getting cascade menu item to not automaticly post

10. Newbie question about cascaded menus in TK

11. Automatically cascade menus?

12. Understanding Cascade Menus

 

 
Powered by phpBB® Forum Software