I’m new, please bear with me?
I am trying to get a bit of data from the user. The only library I’m
using now is watir (since I’m interacting w/ web pages). I can use get
or STDIN.read to grab the input, but I would like to do something like a
typical windows pop-up dialog box. Is there anything out there? If you
point me in the general direction I might be able to find it. I started
checking out the OLE stuff in hopes of finding it, but came back empty
While you can use API calls to create a Yes/No message box, there
doesn’t appear to be a simple API means for creating a dialog for
accepting user string input.
As others have mentioned, you can use one of the GUI toolkits and, if
you have other GUI needs, this is the best option. If, however, the only
GUI need you have is for a single input dialog, you could use the
InputBox function from Excel, via the win32ole library (assuming Excel
def get_input(prompt=’’, title=’’)
excel = WIN32OLE.new(‘Excel.Application’)
response = excel.InputBox(prompt, title)
excel = nil
response = get_input(‘My Prompt’, ‘My Title’)
Hope that helps.