-
|
I misunderstood the docs Reproducer: > gd vendor/
diff --git a/vendor/nappgui_src/cache/demo/guihello/seltext.c b/vendor/nappgui_src/cache/demo/guihello/seltext.c
index edbea0d..1e5a9b1 100644
--- a/vendor/nappgui_src/cache/demo/guihello/seltext.c
+++ b/vendor/nappgui_src/cache/demo/guihello/seltext.c
@@ -63,7 +63,11 @@ static void i_OnCut(SelData *data, Event *e)
if (guicontrol_edit(control) != NULL)
edit_cut(guicontrol_edit(control));
else if (guicontrol_textview(control) != NULL)
+ {
textview_cut(guicontrol_textview(control));
+ textview_select(guicontrol_textview(control), 10, 10);
+ textview_writef(guicontrol_textview(control), "something");
+ }
}
/*---------------------------------------------------------------------------*/
I'm loosing implementing this and I've worked out most of the pieces. I can duplicate this into a issue if required, pls let me know, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Maybe tableview is better suited for my usecase (there is a overhead though), I'll change to it if textview will not provide the feature. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @leelavg! |
Beta Was this translation helpful? Give feedback.
Hi @leelavg!
Indeed,
textview_writef()andtextview_printf()add the text to the end of the control. I'm sorry the documentation isn't explicit about this. As you say, the best solution is to addtextview_writef_at_cursor()andtextview_printf_at_cursor()to avoid breaking the current operation. Please open a ticket in the issue section so other users can be aware. It doesn't seem complicated to implement.