- This works differently to MS Paint. Instead of a color for clearing
(and for the inside of shapes) and a color for brushing (and the
outline of shapes), here there's a background and text color for each
cell, collectively treated like the foreground color in MS Paint.
- There's no way to select a foreground color yet other than opening
an image and using the color picker.
Sure, I'm tacking on these properties, but it's better to tack onto
objects than to tack onto strings. I'm not using a type checker yet,
but this is a better situation for type checking. (I could extend Button
with mini classes within ToolsBox and ColorsBox, if need be, to give
clear ownership of these properties.)
I added the filename = os.path.join(...) which invalidated the positive
filename check. I could move the check earlier, but a negative check
should do nicely.
This commit is mostly a dedent, though git may display the diff poorly
due to the shared line window.close()
I've settled on underscores, for now at least.
Generally I use hyphens.
Built-ins actually use hyphens, like `.-dark-mode`.
Maybe I should be using hyphens.
But for now, consistency is what's important, and I'm using underscores.
Now it's really verbose, but I don't have to worry about reusing
the same name twice. Or coming up with new, fun ones.
https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task
> Important: Save a reference to the result of this function, to avoid a task disappearing mid-execution. The event loop only keeps weak references to tasks. A task that isn’t referenced elsewhere may get garbage collected at any time, even before it’s done. For reliable “fire-and-forget” background tasks, gather them in a collection:
>
> background_tasks = set()
>
> for i in range(10):
> task = asyncio.create_task(some_coro(param=i))
>
> # Add task to the set. This creates a strong reference.
> background_tasks.add(task)
>
> # To prevent keeping references to finished tasks forever,
> # make each task remove its own reference from the set after
> # completion:
> task.add_done_callback(background_tasks.discard)
- Move `self.canvas.magnification = self.magnification` up. It happens,
due to internal call_after_refresh, and should happen, before scroll.
- Remove note about other code in JS Paint, I think it's not needed.
- Note my attempts at fixing flicker, which were unsuccessful, so that
I don't try the exact same things later, and feel stupid,
and so I don't accrue so many branches.