Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Tk Popup menu

by thundergnat (Deacon)
on Mar 01, 2013 at 15:16 UTC ( #1021280=note: print w/replies, xml ) Need Help??


in reply to Tk Popup menu

I must admit, I'm a little puzzled as well. You have all the pieces there, you just need to put them together.

use warnings; use strict; use Tk; my $mw = MainWindow->new; my $text = $mw->Text()->pack; add_edit_popup($mw, $text); MainLoop; sub add_edit_popup { my ($mw, $obj) = @_; my $menu = $mw->Menu( -tearoff => 0, -menuitems => [ [ Cascade => 'Export/Print', -tearoff => 0, -menuitems => [ [ Button => 'MS Word', -command => sub{export_word()} ] +, [ Button => 'MS Excel', -command => sub{export_html()} ] +, ], ], [ Cascade => 'Import', -tearoff => 0, -menuitems => [ [ Button => 'MS Word', -command => sub{import_word()} ], [ Button => 'MS Excel', -command => sub{import_html()} ], ], ], ] ); $obj->menu($menu); $obj->bind('<3>', ['PostPopupMenu', Ev('X'), Ev('Y'), ]); return $obj; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021280]
help
Chatterbox?
jedikaiti is glad to see the conditioning persists...
[jedikaiti]: And yes, I have saved down a copy and added it to my walpaper rotation
[zentara]: jedikaiti my condition has a condition :-)
[jedikaiti]: :-D
[Your Mother]: ♫ You say apod, I say Perl POD ... let's call the whole thing off ♬

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-08-18 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (304 votes). Check out past polls.

    Notices?