File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,14 @@ Filename: <a class=file-link href="https://github.com/gtk-rs/gtk4-rs/blob/master
156
156
{{#rustdoc_include .. / listings / todo / 1 / window / mod . rs: tasks }}
157
157
```
158
158
159
+ We also create a method ` new_task ` which takes the content of the entry, clears the entry and uses the content to create a new task.
160
+
161
+ Filename: <a class =file-link href =" https://github.com/gtk-rs/gtk4-rs/blob/master/book/listings/todo/1/window/mod.rs " >listings/todo/1/window/mod.rs</a >
162
+
163
+ ``` rust ,no_run,noplayground
164
+ {{#rustdoc_include .. / listings / todo / 1 / window / mod . rs: new_task }}
165
+ ```
166
+
159
167
In ` Window::setup_callbacks ` we connect to the "activate" signal of the entry.
160
168
This signal is triggered when we press the enter key in the entry.
161
169
Then a new ` TaskObject ` with the content will be created and appended to the model.
You can’t perform that action at this time.
0 commit comments