mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibGUI: Turn GTextBox into a wrapper around a single-line GTextEditor.
This commit is contained in:
parent
981623f4ee
commit
313ac51832
11 changed files with 25 additions and 260 deletions
|
@ -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());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue