diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-12-08 03:37:27 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-12-08 03:37:27 +0100 |
commit | 319accba370d3f0872501de6386833fea140fbac (patch) | |
tree | f024ac1070837693b39b6624eea3bd104f8a0f0b /tests | |
parent | 864ee5f167d1e2dda9bfce24ef617d71ce49bfd8 (diff) |
Add richtext, support multi language
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 <mgl/mgl.h> #include <mgl/window/window.h> #include <mgl/window/event.h> @@ -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))); } |