I am trying to make a textfield with Cp5. I want the user to be able to edit the textfield, only when a button is pressed. If the button is unpressed the user cannot edit the textfield.
Is there a method in Textfield that can help me with this function?
by the way I am new to the Cp5 library . I couldn’t find any documentations about methods in the library apart from some examples. I just need buttons and text boxes for my Project. Is there a GUI library that is well documented?
I tried setLock() but it didn’t work. I want the user not be able to type anything, when the textfield disabled.
I can’t find a full description for methods in JavaDocs.
for example setLock has only this information
Thank you @svan .
I still don’t know how the library works. I think I implemented the method incorrectly. I put it in the draw function. predicting that the text stayed 2 seconds locked and 2 seconds unlocked. But that didn’t work as I expected.
Two seconds is not very long and draw() is a loop which runs at a default rate of 60 frames/sec if I recall correctly, so that technique won’t work. Now you know. For your future posts it’s always a good idea to post the code that fails initially; this makes it easier for others to help you. You also posted this question in another public forum and I took the liberty to post the above solution in that forum so that others can also benefit from the answer. Thanks for your participation and willingness to provide feedback.