faqts : Computers : Programming : Languages : Python : Tkinter

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 27 people (56%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

how can i create a pop up window with entry on it, so that i can get the value from the entry and process it with the original frame, thanks

Dec 2nd, 2001 21:52
Phrozen Smoke, Scott David Daniels, tony zhang,


I'm not certain, but:

    popup = Pmw.PromptDialog(title='Some Labelling')
    popup.activate()   # This waits for a response
    result = popup.get()

seems to work for me.

----------
There is a way that doesn't use Pmw, just Tkinter, and doesn't require 
you to build your own home-made dialog from scratch.  Here goes:

  import tkSimpleDialog

    myEntry=tkSimpleDialog.askstring("myDialogTitle","myQuestion:")


NOTES: askstring() includes an Entry and "OK" and "Cancel" buttons. 
myEntry should be a string, or None if you user hits "Cancel"
The tkSimpleDialog class also includes other useful methods that work 
the same way, such as:  tkSimpleDialog.askfloat
("myDialogTitle","myQuestion:") and tkSimpleDialog.askinteger
("myDialogTitle","myQuestion:") 

Hope this helps a little more.
  -- PhrozenSmoke