Кнопка не печатает текстC++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Кнопка не печатает текст

Сообщение Anonymous »

У меня проблема: на первом экране кнопки работают, а на следующем нет.

Код: Выделить всё

#include 
#define RAYGUI_IMPLEMENTATION
#include 
#include 
#include 
#include 
#include 
#include 

#define RGB 0xFF
#define GS 0x00

uint8_t ModeChoice() {
uint8_t Mode;
InitWindow(460, 90, "Noise type choice");
bool bRGB = false, bGS = false;
while (!WindowShouldClose() && !bRGB && !bGS) {
BeginDrawing();
ClearBackground(WHITE);
if (GuiButton((Rectangle){20, 20, 200, 50}, "All colors")) bRGB = true;
if (GuiButton((Rectangle){240, 20, 200, 50}, "Gray Scale")) bGS = true;
EndDrawing();
}
CloseWindow();
if (bRGB) Mode = RGB;
else      Mode = GS;
return Mode;
}

uint8_t SizeChoice() {
uint8_t Size;
InitWindow(380, 160, "Size choice");

bool size[6] = {0,0,0,0,0,0};

while (!WindowShouldClose() && !size[0] && !size[1] && !size[2] && !size[3] && !size[4] && !size[5]) {
BeginDrawing();
ClearBackground(WHITE);
if (GuiButton((Rectangle){20, 20, 100, 50}, "100x100")) size[0] = true;
if (GuiButton((Rectangle){140, 20, 100, 50}, "1000x1000")) size[1] = true;
if (GuiButton((Rectangle){260, 20, 100, 50}, "HD")) size[2] = true;
if (GuiButton((Rectangle){20, 90, 100, 50}, "FHD")) size[3] = true;
if (GuiButton((Rectangle){140, 90, 100, 50}, "QHD")) size[4] = true;
if (GuiButton((Rectangle){260, 90, 100, 50}, "4K")) size[5] = true;
EndDrawing();
}
CloseWindow();
if (size[0]) Size = 0xAA;
if (size[1]) Size = 0xBB;
if (size[2]) Size = 0xCC;
if (size[3]) Size = 0xDD;
if (size[4]) Size = 0xEE;
if (size[5]) Size = 0xFF;
return Size;
}

int main() {
uint8_t Mode = ModeChoice();
uint8_t Size = SizeChoice();
std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/79903248/button-not-printing-text[/url]
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»