From 319accba370d3f0872501de6386833fea140fbac Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 8 Dec 2021 03:37:27 +0100 Subject: Add richtext, support multi language --- tests/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/main.c b/tests/main.c index eb1c24f..e1aa6f1 100644 --- a/tests/main.c +++ b/tests/main.c @@ -3,6 +3,7 @@ #include "../include/mgui/scrollview.h" #include "../include/mgui/button.h" #include "../include/mgui/label.h" +#include "../include/mgui/richtext.h" #include #include #include @@ -16,8 +17,8 @@ static mgui_list* create_list_item(const char *title, const char *description) { mgui_list *list = mgui_list_create(MGUI_LIST_VERTICAL); mgui_list_append(container, mgui_list_to_widget(list)); - mgui_list_append(list, mgui_label_to_widget(mgui_label_create(title, strlen(title), 30))); - mgui_list_append(list, mgui_label_to_widget(mgui_label_create(description, strlen(description), 24))); + mgui_list_append(list, mgui_richtext_to_widget(mgui_richtext_create(title, strlen(title), 30))); + mgui_list_append(list, mgui_richtext_to_widget(mgui_richtext_create(description, strlen(description), 24))); return container; } @@ -36,7 +37,7 @@ int main() { mgui_scrollview_set_child(scrollview, mgui_list_to_widget(list)); for(int i = 0; i < 30; ++i) { char text[256]; - snprintf(text, sizeof(text), "hello world %d", i); + snprintf(text, sizeof(text), "hello world 東京 %d", i); mgui_list_append(list, mgui_list_to_widget(create_list_item("User", text))); } -- cgit v1.2.3