Skip to content

Commit 02e1cb6

Browse files
committed
Design Pattern 2B - point out the update calls are not shown in the window until Window.read or Window.refresh are called.
1 parent 9c80a06 commit 02e1cb6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/cookbook.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ window['-OUTPUT-'].update(values['-IN-'])
288288

289289
`window['-OUTPUT-']` returns the element that has the key `'-OUTPUT-'`. Then the `update` method for that element is called so that the value of the Text Element is modified. Be sure you have supplied a `size` that is large enough to display your output. If the size is too small, the output will be truncated.
290290

291-
If you need to interact with elements prior to calling `window.read()` you will need to "finalize" your window first using the `finalize` parameter when you create your `Window`. "Interacting" means calling that element's methods such as `update`, `draw_line`, etc.
291+
There are **two important concepts when updating elements!**
292+
293+
1. If you need to interact with elements prior to calling `window.read()` you will need to "finalize" your window first using the `finalize` parameter when you create your `Window`. "Interacting" means calling that element's methods such as `update`, `expand`, `draw_line`, etc.
294+
2. Your change ***will not be visible in the window until*** you either:
295+
A. Call `window.read()` again
296+
B. Call `window.refresh()
292297

293298
------------
294299

0 commit comments

Comments
 (0)