From 9d5b8e67eb776a02acdd993106d834779f796477 Mon Sep 17 00:00:00 2001 From: Markus Mertama Date: Fri, 2 Feb 2024 09:28:01 +0200 Subject: [PATCH] Update README.md --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8aca63c3..bfda6719 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ is not drawn. To initialize the bitmap, use `Gempyre::Bitmap::Bitmap(0, 0, width Q: How to scale `Gempyre::Bitmap`?
A: You can use browser's bitmap scaling by applying the bitmap as image and then using `Gempyre::FrameComposer` for draw. Look the following snippet: -cpp``` +```cpp // name the image const auto image_key = "/my_image.png"; @@ -136,6 +136,27 @@ const auto texture_draw = [&ui, &texture_images, image_key, clip, rect]() { Q: How to do multiple `Gempyre::FrameComposer` in a single draw? My second draw is not visible
A: Do you call erase? See `GempyreCanvas::draw_completed above. You may also try to call your drawn in a `Ui::after` timer with 0ms delay, that should ensure the correct drawing order. +Q: Why my dynamic HTML ` +``` + +```cpp + + Gempyre::Element show_tags(ui, "show_tags"); + show_tags.remove_attribute("disabled"); // remove disabled + // dynamical add items numerical keys + for(const int value : tag_keys) { + Gempyre::Element opt{ui, "option", show_tags}; + const auto value = std::to_string(value); // make numve as a string + opt.set_attribute("value", GempyreUtils::qq(value)); // The numerical values must be quoted, otherwise JS interpret them as numbers! + opt.set_attribute("name", "tag_option"); + opt.set_html(value); + } + + ``` + ## Example