in reply to Using a Tk window within a function

Hi monks, I want to use a Tk window to ask a user a question inside a function, and then return their answer as the return value.
This is thinking "procedurally" rather than "event driven". In an event driven framework, you would simply put up a new widget somewhere with your question (perhaps in a different window, but not necessarily), and then exit your handler. Assign a callback to the "I'm done" button to trigger a new event to handle what had formerly been the second half of your subroutine.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: Using a Tk window within a function

Replies are listed 'Best First'.
Re: •Re: Using a Tk window within a function
by axis3x3 (Acolyte) on May 27, 2004 at 18:57 UTC
    I agree it is, but unfortunately I'm trying to hack together a GUI version of a very procedural bit of code (the XMLTV tools for grabbing TV listings), so I'm stuck with having to do it this way.