MCPcopy Create free account
hub / github.com/XingangPan/DragGAN / input_text

Function input_text

gui_utils/imgui_utils.py:120–133  ·  view source on GitHub ↗
(label, value, buffer_length, flags, width=None, help_text='')

Source from the content-addressed store, hash-verified

118#----------------------------------------------------------------------------
119
120def 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

Callers

nothing calls this directly

Calls 1

item_widthFunction · 0.85

Tested by

no test coverage detected