Tk Menubutton and OptionMenubutton

A

Alex DeCaria

Can someone please show me some working, sample code for creating Tk
Menubuttons and OptionMenubuttons? I've tried translating from the
Perl/Tk documentation, and also trial and error, with no luck.

Thanks,

-Alex
 
A

Andrew Thompson

@filemenubutton = Tk::Tile::Menubutton.new(@menuframe, :text=>'File',
:width=>-1).pack:)side=>:left)
@filemenu = TkMenu.new(@filemenubutton, :tearoff=>false)
@filemenu.add:)command, :label=>'Quit', :command=>proc{@root.destroy})
@filemenubutton.menu(@filemenu)

That's just a copy and paste from some of my code. Hope it'll give you a
rough idea of what to do.

Andrew
 
H

Hidetoshi NAGAI

From: Alex DeCaria <[email protected]>
Subject: Tk Menubutton and OptionMenubutton
Date: Fri, 16 Mar 2007 04:52:03 +0900
Message-ID: said:
Can someone please show me some working, sample code for creating Tk
Menubuttons and OptionMenubuttons?

Please see 'ext/tk/sample/tkmenubutton.rb' on Ruby source tree.
 
A

Alex DeCaria

Andrew said:
@filemenubutton = Tk::Tile::Menubutton.new(@menuframe, :text=>'File',
:width=>-1).pack:)side=>:left)
@filemenu = TkMenu.new(@filemenubutton, :tearoff=>false)
@filemenu.add:)command, :label=>'Quit', :command=>proc{@root.destroy})
@filemenubutton.menu(@filemenu)

That's just a copy and paste from some of my code. Hope it'll give you a
rough idea of what to do.

Andrew

Thank you!
-Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,237
Messages
2,571,190
Members
47,827
Latest member
wyton

Latest Threads

Top