Forum Archive

Text box for user input using Scene

timjhinton

Hello there,
I’m using the scene module for my project and I am trying to have a small screen pop up with a box for text input. With the UI script it is easy to add a editable text box and drop it on the screen. Can I do the same thing using scene? I went through the documentation hoping that a Labelnode could be set to be editable.
Any suggestions on how to do this?

cvp

@timjhinton you can add an ui.TextField as subview of the view associated to the scene by its
scene.view attribute,

class myscene(Scene):
    def setup(self):
        tf = ui.TextField()
        tf.frame = (10,10,100,32)
        self.view.add_subview(tf)