(label, value, buffer_length, flags, width=None, help_text='')
| 118 | #---------------------------------------------------------------------------- |
| 119 | |
| 120 | def input_text(label, value, buffer_length, flags, width=None, help_text=''): |
| 121 | old_value = value |
| 122 | color = list(imgui.get_style().colors[imgui.COLOR_TEXT]) |
| 123 | if value == '': |
| 124 | color[-1] *= 0.5 |
| 125 | with item_width(width): |
| 126 | imgui.push_style_color(imgui.COLOR_TEXT, *color) |
| 127 | value = value if value != '' else help_text |
| 128 | changed, value = imgui.input_text(label, value, buffer_length, flags) |
| 129 | value = value if value != help_text else '' |
| 130 | imgui.pop_style_color(1) |
| 131 | if not flags & imgui.INPUT_TEXT_ENTER_RETURNS_TRUE: |
| 132 | changed = (value != old_value) |
| 133 | return changed, value |
| 134 | |
| 135 | #---------------------------------------------------------------------------- |
| 136 |
nothing calls this directly
no test coverage detected