kxgames / glooey

An object-oriented GUI library for pyglet.
MIT License
91 stars 6 forks source link

Text Entry #50

Open ShaunKulesa opened 3 years ago

ShaunKulesa commented 3 years ago

It says on the docs main description there should be a text entry, where is it?

kalekundert commented 3 years ago

It's called the Form widget. You can find a brief example here and the API documentation (which is admittedly pretty incomplete) here.

ShaunKulesa commented 3 years ago

Ahh i see thanks. Is there a way to update its position?

ShaunKulesa commented 3 years ago

Never mind figured it out.

kalekundert commented 3 years ago

Glad you figured it out. Let me know if you have any other questions.

ShaunKulesa commented 3 years ago

Last little issue, when I call form.get_text() it says self._layout is None. File "C:\Users\Home\AppData\Local\Programs\Python\Python39-32\lib\site-packages\glooey\text.py", line 518, in get_text return self._label.text File "C:\Users\Home\AppData\Local\Programs\Python\Python39-32\lib\site-packages\glooey\text.py", line 162, in get_text return self._layout.document.text AttributeError: 'NoneType' object has no attribute 'document'

kalekundert commented 3 years ago

Hmm, I'm not sure what this issue is off hand. Did you attach the form to the GUI before calling get_text()? If not, that could be the problem. Otherwise, if you can post post a minimal working example, I can take a look at it (probably later, though).

ShaunKulesa commented 3 years ago

Ahh yes it was because I did it before adding it to gui. Thank you for this Entry/Form. Pyglets one wasn't capable of the things i needed for my engines gui.

ShaunKulesa commented 3 years ago

Probably the last question, how do I get the text when I press enter? I see it already unfocused when I press enter