Tk Menubutton and OptionMenubutton

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

@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

From: Alex DeCaria [email protected]
Subject: Tk Menubutton and OptionMenubutton
Date: Fri, 16 Mar 2007 04:52:03 +0900
Message-ID: [email protected]

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.

Hidetoshi NAGAI wrote:

From: Alex DeCaria [email protected]
Subject: Tk Menubutton and OptionMenubutton
Date: Fri, 16 Mar 2007 04:52:03 +0900
Message-ID: [email protected]

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.

Thank you!
-Alex

Andrew T. wrote:

@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