Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Handling User Input > Asking for Text Input

10.3. Asking for Text Input

Sometimes you need to ask a user for some text input. For example, you may need them to enter a username, password, or some other kind of detail. To do that, use display dialog but add a default answer clause to the end of it.

The default answer doesn't have to contain anything at all; just a "" will do. However, feel free to enter whatever appropriate text might help the user make a good entry. For example, here's a simple dialog that asks for the user's favorite color. Notice that the default answer clause is empty, and so is the accompanying user input widget (Figure 10.7):


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial