Grab on TkToplevel window

T

Tiago

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.
 
H

Hidetoshi NAGAI

Hi,

From: (e-mail address removed) (Tiago)
Subject: Grab on TkToplevel window
Date: Thu, 13 May 2004 03:19:00 +0900
Message-ID: said:
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
 
T

Tiago

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
 

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

No members online now.

Forum statistics

Threads
474,145
Messages
2,570,826
Members
47,371
Latest member
Brkaa

Latest Threads

Top