mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:57:47 +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
|
@ -3,7 +3,7 @@ OBJS = \
|
|||
|
||||
APP = TextEditor
|
||||
|
||||
STANDARD_FLAGS = -std=c++17
|
||||
STANDARD_FLAGS = -std=c++17 -Wno-sized-deallocation
|
||||
WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
|
||||
FLAVOR_FLAGS = -fno-exceptions -fno-rtti
|
||||
OPTIMIZATION_FLAGS = -Os
|
||||
|
|
|
@ -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