GTextEditor: Add selected_text() function.

I don't have a clipboard to actually put the copied selection onto yet,
so just print the selected text to stdout so we can see what it is.
This commit is contained in:
Andreas Kling 2019-03-08 01:59:59 +01:00
commit 6576ac8332
Notes: sideshowbarker 2024-07-19 15:07:36 +09:00
3 changed files with 33 additions and 5 deletions

View file

@ -83,7 +83,7 @@ int main(int argc, char** argv)
});
auto copy_action = GAction::create("Copy", { Mod_Ctrl, Key_C }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/copyfile16.rgb", { 16, 16 }), [&] (const GAction&) {
dbgprintf("FIXME: Implement Edit/Copy");
printf("Copy: \"%s\"\n", text_editor->selected_text().characters());
});
auto paste_action = GAction::create("Paste", { Mod_Ctrl, Key_V }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/paste16.rgb", { 16, 16 }), [&] (const GAction&) {