Input Text GUI template and input text gui_script (SOLVED)

Hello,

I’m trying to create a registration form and have a question for input text. I read through the forum, manual and api reference as well but I can’t find out why the behaviour I guess it should work but it is not worked as expected.

  • GUI consists of : main.gui and main.gui_script attached.
  • Add an input_text.gui to the main.gui as template which contains a text box

[Work]

If I add the code that listens the text_trigger to the main.gui_script, the text inputs are received.

[Not work]

When I separate the gui_script , add a input_text.gui_script to the input_text.ui template. Then move the codes to the new script. The key inputs are not received.

I also added the msg.post(".", “acquire_input_focus”) to the “init” function of the input_text.gui_script.

I added a print(“Load”) to the input_text.gui_script but it was not printed out . Thus the input_text.gui_script is not loaded and executed.

Thanks,
-RG1


Also, if you add a script to the template GUI scene, the script will be
ignored, only one script is tied to each GUI scene and is set on the
scene root node in the Outline view as usual.
You can use modules instead of two gui scripts.

1 Like

Correct. This is most likely the problem @RG1 has come across. gui scripts on gui templates are ignored.

1 Like

Not sure why my camera was not looked at the end of the input manual:-) as it work as design. Anyway, Many thanks @d954mas and @britzl.