iterlab 2.1.0__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. {iterlab-2.1.0 → iterlab-2.2.0}/CHANGELOG.md +59 -0
  2. {iterlab-2.1.0 → iterlab-2.2.0}/GUIDE.md +130 -4
  3. {iterlab-2.1.0 → iterlab-2.2.0}/PKG-INFO +3 -1
  4. {iterlab-2.1.0 → iterlab-2.2.0}/VERIFICATION.md +16 -0
  5. {iterlab-2.1.0 → iterlab-2.2.0}/examples/showcase.py +215 -170
  6. {iterlab-2.1.0 → iterlab-2.2.0}/examples/showcase_layout.py +11 -4
  7. {iterlab-2.1.0 → iterlab-2.2.0}/pyproject.toml +87 -86
  8. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/__init__.py +1 -1
  9. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/codegen/templates.py +18 -0
  10. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/layout/schema.py +599 -557
  11. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/layout/store.py +15 -1
  12. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/dispatch.py +5 -0
  13. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/loader.py +5 -1
  14. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/types.py +3 -1
  15. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/designer.py +765 -738
  16. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/elements.py +947 -941
  17. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/icon.py +7 -0
  18. iterlab-2.2.0/src/iterlab/ui/list_element.py +522 -0
  19. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/palette.py +1 -0
  20. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/properties.py +25 -1
  21. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/theme.py +14 -0
  22. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_handler_menu.py +5 -3
  23. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_icon.py +2 -2
  24. iterlab-2.2.0/tests/ui/test_list_editor.py +65 -0
  25. iterlab-2.2.0/tests/ui/test_list_element.py +505 -0
  26. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_showcase_example.py +252 -183
  27. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_handler_stubs.py +101 -101
  28. iterlab-2.2.0/tests/unit/test_list_layout.py +94 -0
  29. {iterlab-2.1.0 → iterlab-2.2.0}/.gitignore +0 -0
  30. {iterlab-2.1.0 → iterlab-2.2.0}/LICENSE +0 -0
  31. {iterlab-2.1.0 → iterlab-2.2.0}/NOTICE +0 -0
  32. {iterlab-2.1.0 → iterlab-2.2.0}/README.md +0 -0
  33. {iterlab-2.1.0 → iterlab-2.2.0}/docs/intro.gif +0 -0
  34. {iterlab-2.1.0 → iterlab-2.2.0}/docs/iterlab.jpg +0 -0
  35. {iterlab-2.1.0 → iterlab-2.2.0}/docs/logo.png +0 -0
  36. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/app.py +0 -0
  37. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/assets/iterlab.ico +0 -0
  38. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/assets/iterlab.png +0 -0
  39. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/cli.py +0 -0
  40. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/codegen/__init__.py +0 -0
  41. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/codegen/inject.py +0 -0
  42. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/codegen/rename.py +0 -0
  43. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/errors.py +0 -0
  44. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/interface.py +0 -0
  45. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/layout/__init__.py +0 -0
  46. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/py.typed +0 -0
  47. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/__init__.py +0 -0
  48. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/editors.py +0 -0
  49. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/environment.py +0 -0
  50. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/faults.py +0 -0
  51. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/remembered.py +0 -0
  52. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/runtime/startupcheck.py +0 -0
  53. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/__init__.py +0 -0
  54. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/app.py +0 -0
  55. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/dialogs.py +0 -0
  56. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/faultbanner.py +0 -0
  57. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/handler_menu.py +0 -0
  58. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/modetoggle.py +0 -0
  59. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/runner.py +0 -0
  60. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/screenshot.py +0 -0
  61. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/scroll.py +0 -0
  62. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/session.py +0 -0
  63. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/startupnotice.py +0 -0
  64. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/ui/tooltip.py +0 -0
  65. {iterlab-2.1.0 → iterlab-2.2.0}/src/iterlab/versionguard.py +0 -0
  66. {iterlab-2.1.0 → iterlab-2.2.0}/tests/conftest.py +0 -0
  67. {iterlab-2.1.0 → iterlab-2.2.0}/tests/contract/test_layout_schema.py +0 -0
  68. {iterlab-2.1.0 → iterlab-2.2.0}/tests/contract/test_public_api.py +0 -0
  69. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_additive.py +0 -0
  70. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_create_and_run.py +0 -0
  71. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_layout_file.py +0 -0
  72. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_never_dies.py +0 -0
  73. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_reload.py +0 -0
  74. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_rename.py +0 -0
  75. {iterlab-2.1.0 → iterlab-2.2.0}/tests/integration/test_stub_annotations.py +0 -0
  76. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/_helpers.py +0 -0
  77. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/conftest.py +0 -0
  78. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_arming.py +0 -0
  79. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_axes_is_a_real_axes.py +0 -0
  80. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_box_stubs.py +0 -0
  81. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_default_window_size.py +0 -0
  82. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_direct_manipulation.py +0 -0
  83. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_empty_text.py +0 -0
  84. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_fault_banner.py +0 -0
  85. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_input_elements.py +0 -0
  86. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_label_appearance.py +0 -0
  87. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_look.py +0 -0
  88. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_mode_toggle.py +0 -0
  89. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_mouse_buttons.py +0 -0
  90. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_perf.py +0 -0
  91. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_plot_events.py +0 -0
  92. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_presentation_survives.py +0 -0
  93. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_properties_drawer.py +0 -0
  94. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_properties_editing.py +0 -0
  95. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_properties_panel.py +0 -0
  96. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_property_commit.py +0 -0
  97. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_real_launch.py +0 -0
  98. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_resize.py +0 -0
  99. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_restart_app.py +0 -0
  100. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_screenshot.py +0 -0
  101. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_selectors.py +0 -0
  102. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_startup_notice.py +0 -0
  103. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_style_editing.py +0 -0
  104. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_switch_cost.py +0 -0
  105. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_tag_tooltip.py +0 -0
  106. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_toolbar.py +0 -0
  107. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_toolbar_collapse.py +0 -0
  108. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_verify_tool.py +0 -0
  109. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_window_launch.py +0 -0
  110. {iterlab-2.1.0 → iterlab-2.2.0}/tests/ui/test_window_size_memory.py +0 -0
  111. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_atomic_write.py +0 -0
  112. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_cli.py +0 -0
  113. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_editors.py +0 -0
  114. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_element_colours.py +0 -0
  115. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_environment.py +0 -0
  116. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_faults.py +0 -0
  117. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_fresh_compile.py +0 -0
  118. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_import_boundary.py +0 -0
  119. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_label_type.py +0 -0
  120. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_preflight_gate.py +0 -0
  121. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_project_imports.py +0 -0
  122. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_remembered.py +0 -0
  123. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_runnable_file.py +0 -0
  124. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_schema.py +0 -0
  125. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_start_mode.py +0 -0
  126. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_startupcheck.py +0 -0
  127. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_style.py +0 -0
  128. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_templates.py +0 -0
  129. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_typing_surface.py +0 -0
  130. {iterlab-2.1.0 → iterlab-2.2.0}/tests/unit/test_versionguard.py +0 -0
  131. {iterlab-2.1.0 → iterlab-2.2.0}/tools/check_downgrade.py +0 -0
  132. {iterlab-2.1.0 → iterlab-2.2.0}/tools/check_readme_links.py +0 -0
  133. {iterlab-2.1.0 → iterlab-2.2.0}/tools/make_icon.py +0 -0
  134. {iterlab-2.1.0 → iterlab-2.2.0}/tools/preflight.py +0 -0
  135. {iterlab-2.1.0 → iterlab-2.2.0}/tools/verify.py +0 -0
@@ -6,6 +6,65 @@ section, where the public surface is larger than the Python API: the layout
6
6
  schema, the handler naming convention, the `ev` contract, the generated stub
7
7
  shape, and the command are all consumed directly by researcher-written code.
8
8
 
9
+ ## [2.2.0] — 2026-11-22
10
+
11
+ A new element type, and so a minor release rather than the 2.1.1 the fixes
12
+ below were first gathered under. Nothing between them was published.
13
+
14
+ ### Added
15
+
16
+ - **A list element.** Rows of text that your code fills and someone clicks:
17
+ `ev.lst_0.append("run 12")`, `insert`, `del ev.lst_0[i]`, `ev.lst_0[i] = ...`,
18
+ `clear()`, and `ev.lst_0.length`. Deleting a row closes the gap, and there
19
+ are no holes: an index that does not exist raises `IndexError`.
20
+
21
+ Clicking a row calls `on_clicked_lst_0` with `event.index` and `event.text`,
22
+ and highlights it; `ev.lst_0.selected` reads or sets it. Up and Down move the
23
+ selection. **Multi-select**, ticked in the editor, adds rows with Ctrl+click
24
+ and removes them with Alt+click (Cmd and Option on a Mac), and makes
25
+ `.selected` a tuple.
26
+
27
+ The list's font, colours, bold and italic are set in the editor, plus
28
+ **Rows**, the background behind each row. `ev.lst_0.style_line(i, ...)`
29
+ overrides any of them for one row, and that style belongs to the row: it
30
+ moves with it when rows above are added or removed, as the selection does.
31
+
32
+ A scrollbar appears when the rows do not fit, and the list follows new rows
33
+ at the bottom unless you have scrolled up to read. Long rows are cut off;
34
+ **Scroll sideways** in the editor gives a horizontal scrollbar instead.
35
+
36
+ Rows survive a trip to the editor, and a hard reset empties them: they are
37
+ the session's, and never written to the layout.
38
+
39
+ The event gains `index` and `text`, both `None` on every other element.
40
+
41
+ - **The showcase in `examples/` features a list**: one row per region, the best
42
+ and worst marked with `style_line`, and Ctrl+click to pick several regions,
43
+ whose bars stay coloured while the rest grey out. Shuffle rewrites the rows
44
+ in place, so what you picked stays picked.
45
+
46
+ ### Fixed
47
+
48
+ - **On Python 3.15, Hard reset kept an edited helper module.** Before
49
+ re-importing your project's modules, iterlab deletes their compiled cache, so
50
+ a same-size edit saved within a second is not read back as the old code. It
51
+ found that cache through `module.__cached__`, which Python 3.15 removed, so
52
+ on 3.15 it found nothing and deleted nothing, without any error. It now reads
53
+ `module.__spec__.cached`, which has held the same path since Python 3.4.
54
+
55
+ - **On Python 3.15, the window icon was a thin outline.** 3.15 ships Tk 9,
56
+ which gives a window its default icon from the wrong frame of the `.ico`:
57
+ the 256 px artwork squeezed into the title bar. The icon is now also set on
58
+ the window itself, which picks the 16 px frame on Tk 9 and on Tk 8.6 alike.
59
+
60
+ ### Testing
61
+
62
+ - **CI runs the headless suite on Python 3.15** as well as 3.10 and 3.12. Both
63
+ bugs above were caught by existing tests the first time the suite ran on
64
+ 3.15, and the first one would have been caught by CI.
65
+
66
+ - **The downgrade job now opens a project with 2.1.0**, the newest release.
67
+
9
68
  ## [2.1.0] — 2026-09-26
10
69
 
11
70
  ### Added
@@ -149,7 +149,7 @@ Write only the ones you want:
149
149
  | `on_clicked_<tag>(ev, event)` | A mouse button is pressed on it | Every element |
150
150
  | `on_hover_<tag>(ev, event)` | The pointer enters it | Every element |
151
151
  | `on_motion_<tag>(ev, event)` | The pointer moves over it | Every element |
152
- | `on_key_<tag>(ev, event)` | A key is pressed while it has focus | Axes, text box, number box |
152
+ | `on_key_<tag>(ev, event)` | A key is pressed while it has focus | Axes, text box, number box, list |
153
153
  | `on_changed_<tag>(ev, event)` | A box's value is committed — Enter, or leaving it after an edit | Text box, number box |
154
154
 
155
155
  `on_key_` exists only on what a click gives the keyboard to. Clicking a button, a selector or a
@@ -199,6 +199,7 @@ In GUI mode a right-click is yours: it reaches `on_clicked_<tag>` with `event.bu
199
199
  | `event.key` | The key, on key events |
200
200
  | `event.double` | Whether a click was a double click |
201
201
  | `event.path` | On a file or folder selector's click, what was chosen; `None` elsewhere. A cancelled dialog calls no handler |
202
+ | `event.index`, `event.text` | On a list, the row clicked or under the pointer, and its text; `None` elsewhere |
202
203
 
203
204
  `event.x` and `event.y` are in your plot's own units. Click a spectrum at 512 nm and you get
204
205
  `512.0`, not a pixel offset.
@@ -207,9 +208,9 @@ In GUI mode a right-click is yours: it reaches `on_clicked_<tag>` with `event.bu
207
208
 
208
209
  ## Elements
209
210
 
210
- Seven types so far. Each is drawn in the editor and reached in code as `ev.<tag>`.
211
+ Eight types so far. Each is drawn in the editor and reached in code as `ev.<tag>`.
211
212
 
212
- New elements are tagged by type — `ax_0`, `cmd_0`, `lbl_0`, `edt_0`, `val_0` — and numbered upward.
213
+ New elements are tagged by type — `ax_0`, `cmd_0`, `lbl_0`, `edt_0`, `val_0`, `lst_0` — and numbered upward.
213
214
  The two selectors are the exception: the first is just `fileselect` and `folderselect`, with no
214
215
  number, because an interface almost always has one of each. A second becomes `fileselect_1`.
215
216
  Rename any of them in the editor.
@@ -414,6 +415,131 @@ folder chooser by file type would mean nothing.
414
415
  Both fire `on_clicked_<tag>` **after** a choice, so `.path` is already set when your code runs.
415
416
  Cancelling the dialog does nothing at all: no handler, no change.
416
417
 
418
+ ### List
419
+
420
+ Rows of text that your code fills, and someone clicks.
421
+
422
+ ```python
423
+ def on_startup(ev):
424
+ for name in ("spectrum_a.csv", "spectrum_b.csv", "spectrum_c.csv"):
425
+ ev.lst_0.append(name)
426
+
427
+ def on_clicked_lst_0(ev, event):
428
+ ev.data = np.loadtxt(event.text) # event.index is the row, 0 at the top
429
+ ```
430
+
431
+ A list is empty until code adds rows. It behaves much like a Python list of strings:
432
+
433
+ | In code | |
434
+ |---|---|
435
+ | `ev.lst_0.append(text)` | add a row at the bottom |
436
+ | `ev.lst_0.extend(texts)` | add several, faster than one at a time |
437
+ | `ev.lst_0.insert(i, text)` | add a row so it becomes row `i`; the rows from there move down |
438
+ | `del ev.lst_0[i]`, `ev.lst_0.delete(i)` | remove a row; the rows below move up to close the gap |
439
+ | `ev.lst_0[i]` | a row's text; `ev.lst_0[-1]` is the last |
440
+ | `ev.lst_0[i] = text` | replace a row's text, keeping its style |
441
+ | `ev.lst_0.length`, `len(ev.lst_0)` | how many rows |
442
+ | `ev.lst_0.lines` | every row's text, as a tuple |
443
+ | `ev.lst_0.clear()` | remove every row |
444
+ | `ev.lst_0.selected` | the selected row's index, or `None` |
445
+ | `ev.lst_0.style_line(i, ...)` | how one row looks |
446
+
447
+ There are no holes: `insert` takes any index from `0` to `length`, and asking for a row that does
448
+ not exist raises `IndexError`, which shows in the banner like any other mistake. Anything you add
449
+ is turned into text, so `append(3.5)` works.
450
+
451
+ **A whole Python list at once** goes in with `extend`, below any rows already there. It is faster
452
+ than `append` in a loop, which matters with thousands of rows, and takes any iterable:
453
+
454
+ ```python
455
+ names = ["spectrum_a.csv", "spectrum_b.csv", "spectrum_c.csv"]
456
+ ev.lst_0.extend(names)
457
+ ```
458
+
459
+ To **replace** what the list holds rather than add to it, clear it first. That drops the old rows'
460
+ styles and selection too, since those belong to the rows:
461
+
462
+ ```python
463
+ from pathlib import Path
464
+
465
+ ev.lst_0.clear()
466
+ ev.lst_0.extend(sorted(Path(folder).glob("*.csv"))) # Path objects become text
467
+ ```
468
+
469
+ `.lines` gives the rows back as a tuple, but only reads: assigning to it is an error.
470
+
471
+ **Reading the selection.** `ev.lst_0.selected` is the selected row's index, or `None`. Read it from
472
+ anywhere, such as a button that acts on the chosen row:
473
+
474
+ ```python
475
+ def on_clicked_cmd_0(ev, event):
476
+ row = ev.lst_0.selected
477
+ if row is not None:
478
+ ev.data = np.loadtxt(ev.lst_0[row])
479
+ ```
480
+
481
+ **Clicking a row** calls `on_clicked_lst_0` with `event.index` and `event.text`, and highlights
482
+ the row. It stays highlighted until another row is clicked; set `ev.lst_0.selected` to change it
483
+ from code. Clicking the empty space below the last row does nothing. The **Up** and **Down** keys
484
+ move the selection and count as clicking the new row, with `event.key` set to say so. A right-click
485
+ reports its row with `event.button == "right"` and leaves the selection alone.
486
+
487
+ **Multi-select**, ticked in the editor, lets several rows be selected at once: **Ctrl**+click adds a
488
+ row and **Alt**+click removes one (**Cmd** and **Option** on a Mac). A plain click starts again
489
+ from that row. `ev.lst_0.selected` is then a tuple of indexes in order, `()` when nothing is
490
+ selected:
491
+
492
+ ```python
493
+ for row in ev.lst_0.selected: # e.g. (1, 3, 4)
494
+ print(row, ev.lst_0[row])
495
+ ```
496
+
497
+ Setting it works in both modes: `ev.lst_0.selected = 2`, `= (0, 2)` with Multi-select, or `= None`.
498
+ Inside `on_clicked_lst_0`, `event.index` is the row just clicked, which is not always selected:
499
+ after an Alt+click it is the row just removed. Read `.selected` for what is selected now.
500
+
501
+ **One row's look** is set by its index, and any of these can be given:
502
+
503
+ ```python
504
+ ev.lst_0.style_line(2, text_color="red", highlight="#fff4d6", bold=True,
505
+ italic=False, font="Consolas", font_size=12)
506
+ ev.lst_0.style_line(2, text_color=None) # back to the list's own colour
507
+ ```
508
+
509
+ `text_color` is the colour of the row's text and `highlight` the background behind it. For
510
+ example, marking each result as it comes in:
511
+
512
+ ```python
513
+ def on_clicked_run_all(ev, event):
514
+ ev.lst_0.clear()
515
+ for name in ev.files:
516
+ ev.lst_0.append(name)
517
+ if fit(name).ok:
518
+ ev.lst_0.style_line(-1, text_color="#1a7f37") # green text
519
+ else:
520
+ ev.lst_0.style_line(-1, text_color="#b42318", highlight="#fde8e8") # red on pink
521
+ ```
522
+
523
+ Each call adds to what the row already has, so a later `style_line(i, bold=True)` keeps the
524
+ colours. `None` takes one property back to the list's own. The properties are `text_color`,
525
+ `highlight`, `font`, `font_size`, `bold` and `italic`; anything else, or a colour Tk does not
526
+ know, is refused and the row is left as it was.
527
+
528
+ A row's style belongs to the row, not to its position. Delete row 0 and the red row moves from
529
+ index 2 to 1, and is still red. Its selection moves with it the same way.
530
+
531
+ The list's own look is set in the editor like any other element's, with one more colour,
532
+ **Rows**: the background behind every row. **Fill** is the empty area around them. Code can
533
+ change either: `ev.lst_0.highlight = "#eef"`.
534
+
535
+ **Long lists** get a scrollbar when the rows do not fit. When code adds a row at the bottom while
536
+ you are looking at the bottom, the list follows it, like a log. If you have scrolled up to read,
537
+ it leaves you where you are. **Long rows** are cut off at the edge. Tick **Scroll sideways** in the
538
+ editor to get a horizontal scrollbar instead.
539
+
540
+ Rows, their styles and the selection survive a trip to the editor. **Hard reset** and closing the
541
+ window empty the list, since what is in it came from your code.
542
+
417
543
  ---
418
544
 
419
545
  ## Styling
@@ -796,5 +922,5 @@ Worth knowing before they surprise you.
796
922
 
797
923
  ---
798
924
 
799
- **Guide version 2.1.0.** Everything above is verified against that release. If a description here
925
+ **Guide version 2.2.0.** Everything above is verified against that release. If a description here
800
926
  does not match what you see, please report it — a wrong guide is worse than a missing one.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: iterlab
3
- Version: 2.1.0
3
+ Version: 2.2.0
4
4
  Summary: The GUI as a development environment for algorithms - draw the interface, iterate on the code without restarting
5
5
  Project-URL: Homepage, https://github.com/alonhzn/iterlab
6
6
  Project-URL: Documentation, https://github.com/alonhzn/iterlab/blob/main/GUIDE.md
@@ -223,6 +223,7 @@ Classifier: Programming Language :: Python :: 3.10
223
223
  Classifier: Programming Language :: Python :: 3.11
224
224
  Classifier: Programming Language :: Python :: 3.12
225
225
  Classifier: Programming Language :: Python :: 3.13
226
+ Classifier: Programming Language :: Python :: 3.15
226
227
  Classifier: Topic :: Scientific/Engineering
227
228
  Classifier: Topic :: Scientific/Engineering :: Visualization
228
229
  Requires-Python: >=3.10
@@ -230,6 +231,7 @@ Requires-Dist: matplotlib>=3.5
230
231
  Requires-Dist: numpy>=1.21
231
232
  Provides-Extra: dev
232
233
  Requires-Dist: pytest>=7.0; extra == 'dev'
234
+ Requires-Dist: twine>=5.0; extra == 'dev'
233
235
  Description-Content-Type: text/markdown
234
236
 
235
237
  <h1><img src="https://raw.githubusercontent.com/alonhzn/iterlab/main/docs/logo.png" alt="" width="40" height="40"> iterlab</h1>
@@ -74,6 +74,7 @@ is *there*; only a person can see that the window still looks like the session t
74
74
  | 41 | Draw several elements, then open `demo.py` | The `if __name__` block is still at the bottom, with the new handlers above it and one blank line's worth of ordinary spacing | Ordering is asserted; whether the file still reads as something a person wrote is not |
75
75
  | 42 | Type into a property field, then click straight onto another element | The value is saved. Repeat a few times with different fields | This broke twice in two releases, in different ways, and both times the automated check passed while a person could see it fail |
76
76
  | 60 | **[!]** Right-click an element in the editor and choose its handler, once from VS Code and once from PyCharm if you have both, and once with the other one picked in the heading | Your editor comes to the front with the cursor on the handler's `def` line, in the window you already had open rather than a new one | Tests check the command each editor is sent. Whether that editor honours it, raises its window, and reuses the open project is up to the editor, and only visible on screen |
77
+ | 61 | **[!]** Draw a list, fill it from `on_startup` with a few hundred rows, style a few with `style_line`, then click, Ctrl+click and Alt+click rows with Multi-select on, and scroll | Rows read cleanly at a glance; the selected rows stand out from styled ones without hiding them; scrolling and the follow-the-bottom behaviour feel natural, and Ctrl/Alt (Cmd/Option on a Mac) do what you expect | The indexes, tags and scroll positions are asserted. Whether the selection colour is legible over a row's own highlight, and whether the list feels like a list, is only visible on screen |
77
78
  | 39a | Type in the box, then click straight onto another element without pressing Enter | The handler runs once, on the way out | Focus-loss commit is asserted through a synthesised event; only a person can confirm a real click out of the box does it |
78
79
  | 39b | Click into a box, change nothing, click away | Nothing runs | The rule that keeps a plot from redrawing when someone merely clicks past |
79
80
  | 43 | **[!]** In the editor, move the pointer across several elements without stopping | Tags appear only where you pause, not as a trail of boxes flickering past | The delay is asserted as a number; whether 200 ms *feels* like an answer rather than a flicker or a wait is the only thing that matters and cannot be measured |
@@ -167,6 +168,7 @@ One row per release. An empty table means nothing has been released.
167
168
  | 2.0.0 | 2026-09-14 | Windows 11 | Pass — reported by the maintainer | 0 |
168
169
  | 2.0.1 | 2026-09-14 | Windows 11 | Pass — reported by the maintainer, recorded 2026-09-26 | 0 |
169
170
  | 2.1.0 | 2026-09-26 | Windows 11 | Pass — reported by the maintainer | 0 in the pass; 3 found by hand before it (see below) |
171
+ | 2.2.0 | 2026-11-22 | Windows 11, Python 3.15 | Pass — reported by the maintainer | 0 |
170
172
 
171
173
  ### 2026-09-07 — development walkthrough
172
174
 
@@ -251,3 +253,17 @@ test before the pass:
251
253
  the keyboard when clicked. It is now offered only where it can fire.
252
254
  - The first switch to the interface paused while matplotlib imported. It now
253
255
  imports while the window opens.
256
+
257
+ ### 2026-11-22 — 2.2.0
258
+
259
+ The list element, and the first release run on Python 3.15 and Tk 9. One new
260
+ item (61) for how a list reads and selects; the showcase in `examples/` now
261
+ features one, which is the easiest way to work through it.
262
+
263
+ Worked through on Windows 11 under Python 3.15 by the maintainer, who reported
264
+ it passing. Nothing recorded as found in the pass itself.
265
+
266
+ Found before the pass, and fixed with Gate 1 tests: on Python 3.15, Hard reset
267
+ kept an edited helper module, because `module.__cached__` was removed; and the
268
+ title-bar icon was the 256 px art squeezed into the title bar under Tk 9. Both
269
+ were caught by existing tests the first time the suite ran on 3.15.