block Gui::InputField for user input

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

block Gui::InputField for user input

Post by bernd »

class reference for Gui::InputField: https://www.freecadweb.org/api/da/dfa/c ... Field.html

Is it possible to block a Gui::InputField for user input. I use them, but in a special case I would like to lock the input field for user input to be sure the user does not change a value by accident. It should work like a label in this case. Is this somehow possible?

bernd
wmayer
Founder
Posts: 20300
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: block Gui::InputField for user input

Post by wmayer »

Code: Select all

ui=Gui.UiLoader()
w=ui.createWidget("Gui::InputField")
w.show()
w.setReadOnly(True)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: block Gui::InputField for user input

Post by bernd »

:D
Post Reply