LaRossa
Потрачен
- 429
- 117
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Подскажите, почему кнопка "очистить" срабатывает только на 1-ю строчку, а остальные кнопки не очищают свои строки
Screenshot(http://prntscr.com/lmvmhe)
C++:
char MSG[5][1024] = { "null", "null", "null", "null", "null" };
void MSGButton(int number)
{
ImGui::SameLine();
if (ImGui::Button(u8"Очистить")) {
sprintf(MSG[number], "null");
}
}
ImGui::InputText( "#1", MSG[0], _countof(MSG[0]) );
MSGButton(0);
ImGui::InputText( "#2", MSG[1], _countof(MSG[1]) );
MSGButton(1);
ImGui::InputText( "#3", MSG[2], _countof(MSG[2]) );
MSGButton(2);
ImGui::InputText( "#4", MSG[3], _countof(MSG[3]) );
MSGButton(3);
ImGui::InputText( "#5", MSG[4], _countof(MSG[4]) );
MSGButton(4);