locked
Text input to GraphicsWindow RRS feed

  • Question

  • How can I do this in  a graphics window -

    TextWindow.Title = "Password"

    Textwindow.Writeline("What is the password?")

    pass = TextWindow.Read()

    I need the user to input the password into the graphics window without having the text window open and then transferring it?

    -Ben,15



    • Edited by sbquestionss Saturday, November 2, 2013 7:27 PM
    • Edited by litdev Sunday, November 3, 2013 5:09 PM New title
    Saturday, November 2, 2013 3:51 PM

Answers

  • Its not quite as easy to do text input/output in GraphicsWindow, the title is easy though GraphicsWindow.Title.

    The best way is to use Shapes and Controls, like textbox, button etc - you can move, hide create, delete these as needed.

    You also need to get the password from a textbox when a button is pressed.

    Here is a starter

    GraphicsWindow.Title = "Password"
    input = Shapes.AddText("Enter Password")
    Shapes.Move(input,10,10)
    textbox = Controls.AddTextBox(10,40)
    button = Controls.AddButton("Enter",10,80)
    Controls.ButtonClicked = OnButtonClicked
    
    Sub OnButtonClicked
      password = Controls.GetTextBoxText(textbox)
      TextWindow.WriteLine("password entered "+password)
    EndSub

    • Marked as answer by sbquestionss Saturday, November 2, 2013 5:15 PM
    Saturday, November 2, 2013 4:10 PM

All replies

  • Its not quite as easy to do text input/output in GraphicsWindow, the title is easy though GraphicsWindow.Title.

    The best way is to use Shapes and Controls, like textbox, button etc - you can move, hide create, delete these as needed.

    You also need to get the password from a textbox when a button is pressed.

    Here is a starter

    GraphicsWindow.Title = "Password"
    input = Shapes.AddText("Enter Password")
    Shapes.Move(input,10,10)
    textbox = Controls.AddTextBox(10,40)
    button = Controls.AddButton("Enter",10,80)
    Controls.ButtonClicked = OnButtonClicked
    
    Sub OnButtonClicked
      password = Controls.GetTextBoxText(textbox)
      TextWindow.WriteLine("password entered "+password)
    EndSub

    • Marked as answer by sbquestionss Saturday, November 2, 2013 5:15 PM
    Saturday, November 2, 2013 4:10 PM
  • Try the following:

    GraphicsWindow.DrawText(100,100,"password")
    GraphicsWindow.TextInput=inp
    While text.GetLength(tt)<5
    Program.Delay(30)
    endwhile
    GraphicsWindow.DrawText(200,200,tt)
    
    Sub inp
      tt=tt+GraphicsWindow.LastText
    EndSub
    


    Jan [ WhTurner ] The Netherlands

    Saturday, November 2, 2013 4:15 PM
    Answerer
  • Okay thanks i think this will work,I should be able to work with this to make the program needed,thanks alot:)
    Saturday, November 2, 2013 4:16 PM
  • A more elaborate solution -> THP414-1

    hidden-password-input-for-graphicswindow


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Saturday, November 2, 2013 6:56 PM
    Answerer
  • @ sbquestionss,

    Thanks for marking your questions as answered.  However, please do not rename your post to "Answered" as this makes it hard for others with similar questions to identify what the question was about when they search for previous possible answers to their questions - Thanks.

    I will change the post name to something appropriate.
    • Edited by litdev Sunday, November 3, 2013 5:09 PM
    Sunday, November 3, 2013 5:08 PM