From 02bde3930da75b1128605a340331dcff268b031b Mon Sep 17 00:00:00 2001 From: gintama91 Date: Thu, 5 Oct 2023 10:32:29 +0530 Subject: [PATCH] remove docker , added accidentally --- examples/para/para_text.rb | 14 ++++++++++++++ lacci/lib/shoes/widgets/para.rb | 11 ++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 examples/para/para_text.rb diff --git a/examples/para/para_text.rb b/examples/para/para_text.rb new file mode 100644 index 000000000..dbdd46f1b --- /dev/null +++ b/examples/para/para_text.rb @@ -0,0 +1,14 @@ +Shoes.app do + stack do + @note = para " your note will appear here" + + @edit_box = edit_box "" + @save_button = button "Save" + + @save_button.click do + new_text = @edit_box.text + @note.text = new_text + alert("Note saved successfully!") + end + end +end diff --git a/lacci/lib/shoes/widgets/para.rb b/lacci/lib/shoes/widgets/para.rb index e12a339aa..65de4705e 100644 --- a/lacci/lib/shoes/widgets/para.rb +++ b/lacci/lib/shoes/widgets/para.rb @@ -29,8 +29,17 @@ def text_children_to_items(text_children) end def replace(*children) - @text_children = children + update_text_children(*children) + end + + def text=(children) + update_text_children(*children) + end + + private + def update_text_children(*children) + @text_children = children # This should signal the display widget to change self.text_items = text_children_to_items(@text_children) end