Grab on TkToplevel window

Hello,
I’m using Tk for the first time and had this problem that I cannot
solve.
Is it possible to grab a toplevel window like a dialog box?
I have something like this:
window=TkToplevel.new
window.grab

and I get this message:
Error:/usr/lib/ruby/1.8/tk.rb:1623:in `__invoke’: grab failed: window
not viewable

As an alternative I can use a dialog box, but I need to return a
string from the user. Is it possible to put a TkEntry in a dialog box?
How?

Thanks for your time.
Tiago Veiga.

Hi,

···

From: tveiga@veiga.sytes.net (Tiago)
Subject: Grab on TkToplevel window
Date: Thu, 13 May 2004 03:19:00 +0900
Message-ID: af5442f1.0405121017.21a2ccb6@posting.google.com

Is it possible to grab a toplevel window like a dialog box?
I have something like this:
window=TkToplevel.new
window.grab

and I get this message:
Error:/usr/lib/ruby/1.8/tk.rb:1623:in `__invoke’: grab failed: window
not viewable

Probably there are two effective ways.

(1) window = TkToplevel.new
Tk.update
window.grab

(2) window = TkToplevel.new
window.wait_visibility
window.grab


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

Probably there are two effective ways.

(1) window = TkToplevel.new
Tk.update
window.grab
Worked, thanks a lot.

(2) window = TkToplevel.new
window.wait_visibility
window.grab

I get the same error with this one