Back to index

python3.2  3.2.2
Classes | Functions
tkinter.simpledialog Namespace Reference

Classes

class  SimpleDialog
class  Dialog
class  _QueryDialog
class  _QueryInteger
class  _QueryFloat
class  _QueryString

Functions

def askinteger
def askfloat
def askstring
def test

Function Documentation

def tkinter.simpledialog.askfloat (   title,
  prompt,
  kw 
)
get a float from the user

Arguments:

    title -- the dialog title
    prompt -- the label text
    **kw -- see SimpleDialog class

Return value is a float

Definition at line 349 of file simpledialog.py.

00349 
00350 def askfloat(title, prompt, **kw):
00351     '''get a float from the user
00352 
00353     Arguments:
00354 
00355         title -- the dialog title
00356         prompt -- the label text
00357         **kw -- see SimpleDialog class
00358 
00359     Return value is a float
00360     '''
00361     d = _QueryFloat(title, prompt, **kw)
00362     return d.result

Here is the caller graph for this function:

def tkinter.simpledialog.askinteger (   title,
  prompt,
  kw 
)
get an integer from the user

Arguments:

    title -- the dialog title
    prompt -- the label text
    **kw -- see SimpleDialog class

Return value is an integer

Definition at line 330 of file simpledialog.py.

00330 
00331 def askinteger(title, prompt, **kw):
00332     '''get an integer from the user
00333 
00334     Arguments:
00335 
00336         title -- the dialog title
00337         prompt -- the label text
00338         **kw -- see SimpleDialog class
00339 
00340     Return value is an integer
00341     '''
00342     d = _QueryInteger(title, prompt, **kw)
00343     return d.result

Here is the caller graph for this function:

def tkinter.simpledialog.askstring (   title,
  prompt,
  kw 
)
get a string from the user

Arguments:

    title -- the dialog title
    prompt -- the label text
    **kw -- see SimpleDialog class

Return value is a string

Definition at line 381 of file simpledialog.py.

00381 
00382 def askstring(title, prompt, **kw):
00383     '''get a string from the user
00384 
00385     Arguments:
00386 
00387         title -- the dialog title
00388         prompt -- the label text
00389         **kw -- see SimpleDialog class
00390 
00391     Return value is a string
00392     '''
00393     d = _QueryString(title, prompt, **kw)
00394     return d.result
00395 
00396 

Here is the caller graph for this function:

Definition at line 399 of file simpledialog.py.

00399 
00400     def test():
00401         root = Tk()
00402         def doit(root=root):
00403             d = SimpleDialog(root,
00404                          text="This is a test dialog.  "
00405                               "Would this have been an actual dialog, "
00406                               "the buttons below would have been glowing "
00407                               "in soft pink light.\n"
00408                               "Do you believe this?",
00409                          buttons=["Yes", "No", "Cancel"],
00410                          default=0,
00411                          cancel=2,
00412                          title="Test Dialog")
00413             print(d.go())
00414             print(askinteger("Spam", "Egg count", initialvalue=12*12))
00415             print(askfloat("Spam", "Egg weight\n(in tons)", minvalue=1,
00416                            maxvalue=100))
00417             print(askstring("Spam", "Egg label"))
00418         t = Button(root, text='Test', command=doit)
00419         t.pack()
00420         q = Button(root, text='Quit', command=t.quit)
00421         q.pack()
00422         t.mainloop()

Here is the call graph for this function: