PageRenderTime 30ms CodeModel.GetById 17ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/Tests/25-password.py

https://bitbucket.org/alsh/pygui-mirror
Python | 25 lines | 21 code | 4 blank | 0 comment | 0 complexity | ab29187eac30fb7ec99e6c9c7d240909 MD5 | raw file
 1from GUI import Window, TextField, Button, application
 2
 3def show(tf):
 4    print "Text = %r" % tf.text
 5
 6def make_window():
 7    win = Window(size = (240, 100), title = "Password")
 8    tf = TextField(position = (20, 20), width = 200, password = True)
 9    ok = Button("OK", position = (20, 60),	action = (show, tf))
10    win.add(tf)
11    win.add(ok)
12    win.show()
13
14make_window()
15
16instructions = """
17There should be a window containing a password entry field.
18Text in the field should be obfuscated, and it should not be
19possible to copy text out of the field. The OK button should
20cause the contents of the field to be reported.
21"""
22
23print instructions
24
25application().run()