Ruby/Tk :: Opening a new window when selecting menu items

Hey everyone.

Just a quick question, how might I go about setting up commands to open new windows, when a user clicks a menu item. I.E, a menu has the following selections: FILE, EDIT, and ABOUT.

Inside of FILE, are the following items: OPEN, CLOSE, EDIT, EXIT.

I want to have a new window popup (not a dialog box), when OPEN is clicked (selected). Is there a way to do so!? Here is my current code:

filemenu.add(‘command’, ‘command’=>proc { TkWindow.new() { pack(‘side’=>‘left’) } } )

If anyone would be willing to write a script that does this, I would greatly apreciate it. I want something to use as a guideline, and something to study. Thanks for the help you guys.

->Kryptik

···


Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Hi,

···

From: kryptik@usa.com
Subject: Ruby/Tk :: Opening a new window when selecting menu items
Date: Wed, 19 Mar 2003 05:09:20 +0900
Message-ID: 20030318200914.58433.qmail@mail.com

filemenu.add(‘command’, ‘command’=>proc { TkWindow.new() { pack(‘side’=>‘left’) } } )

Use TkToplevel class to cleate a new window.
TkWindow class is NOT a widget class.

                              Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)