LibGUI: Turn GTextBox into a wrapper around a single-line GTextEditor.

This commit is contained in:
Andreas Kling 2019-04-10 03:08:29 +02:00
commit 313ac51832
Notes: sideshowbarker 2024-07-19 14:46:52 +09:00
11 changed files with 25 additions and 260 deletions

View file

@ -26,9 +26,9 @@ int main(int argc, char** argv)
auto* text_editor = new GTextEditor(GTextEditor::MultiLine, widget);
auto* statusbar = new GStatusBar(widget);
text_editor->on_cursor_change = [statusbar] (GTextEditor& editor) {
text_editor->on_cursor_change = [statusbar, text_editor] {
StringBuilder builder;
builder.appendf("Line: %d, Column: %d", editor.cursor().line(), editor.cursor().column());
builder.appendf("Line: %d, Column: %d", text_editor->cursor().line(), text_editor->cursor().column());
statusbar->set_text(builder.to_string());
};