Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users
    • Groups
    • Solved
    • Unsolved
    • Search
    1. Home
    2. Lorp
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by Lorp

    • Idea: get input() to display modal dialog to enter text

      Would it be possible, when DrawBot encounters input() or raw_input(), to have it display a modal dialog to obtain a string from the user, rather like prompt() in JavaScript? This would be a super easy way of getting input from a user, and would allow code to be reused on the command line.

      I ran the idea past Frederik and he suggested trying Variable(). Compare:

      print ("What is the sample text?")
      Variable([
          dict(name="sampleText", ui="EditText")
          ], globals())
      print (sampleText)
      

      with…

      sampleText = input("What is the sample text?")
      print (sampleText)
      

      I know I’ll never remember the first construction 😞 The Variable() dialog hangs around even after I have got the user input, which isn’t a nice experience. When the user closes the dialog, it’s gone forever.

      posted in Feature Requests
      Lorp
      Lorp