add ActivityIndicator for Winforms#3473
Conversation
|
This is untested as I do not have a Windows machine. If someone has a Windows machine: please help me test this, thanks. |
|
I haven't written any tests yet. I'll be happy for any guidance on how to do so, though I'm practically limited to a macOS machine. |
freakboy3742
left a comment
There was a problem hiding this comment.
One simplification suggestion and a tweak to the release note; there's also a need for two documentation updates:
- An update to the widget availability chart data
- A screenshot on the ActivityIndicator docs page
As for testing - you don't need to write any new tests; you only need to write a probe implementation. The probe provides a generic interface by which the set of existing tests validates the behavior of the widget is consistent. You can use the existing ActivityIndicator probe on any other platform as a starting point for finding the methods that need to be defined; as soon as the probe class exists, the testbed will run the tests on Winforms.
|
Done. I cannot provide a screenshot since... I don't have a windows machine laying around. |
|
Also... I'm not 100% confident that this is a good spinner. By the way, let me add a LICENSE to my spinner-anim. Do you think we should link it in the docs so there's no question about the origins of that file? |
|
I apologize for a0dc0a0 after the review was requested; I misread your comment. |
This comment was marked as resolved.
This comment was marked as resolved.
|
OK... so how am I supposed to have complete coverage? Where should I add more tests to cover everything? |
Ah - I forgot one more change - in the testbed's tests_activityindicator, you need to remove windows from the skip list. As for the screenshot - I'll need to wait until I'm back at home before I can test this and get an actual screenshot. |
|
So like *we*'re supporting AcitivityIndicator on Winforms rather than the
Winforms backend providing it...
…On Mon, May 19, 2025 at 9:32 PM Russell Keith-Magee < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In changes/3473.feature.rst
<#3473 (comment)>:
> @@ -0,0 +1 @@
+Support ActivityIndicator on WinForms.
I'm not sure I understand what you're referring to... there's no "we" in
this sentence, implicit or otherwise...
—
Reply to this email directly, view it on GitHub
<#3473 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BRODAIYGHMNJO7DI25EUWED27KH5FAVCNFSM6AAAAAB5PDWHZOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQNJSGM3TINZRGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The release notes are in the voice of "This project now has a feature that...". They're in a very different voice to comments in the code, and PRs - in those contexts, we try to be "egoless" in the sense that we're describing what the code does, not describing our deep personal struggle to find a solution to something. |
|
OK so needs adding to Winforms Factory __all__ and also imports, also need
to do from System.Drawing import Image at top of file and wrap
the self.native.Image = in a Image.FromFile stuff
With that I can get it running but I can't see the image - will commit the
changes when I get home today, I found a way to get Python on my school
laptop (legally)
…On Tue, May 20, 2025 at 10:22 AM Russell Keith-Magee < ***@***.***> wrote:
*freakboy3742* left a comment (beeware/toga#3473)
<#3473 (comment)>
So like *we*'re supporting AcitivityIndicator on Winforms rather than the
Winforms backend providing it...
The release notes are in the voice of "This project now has a feature
that...".
They're in a very different voice to comments in the code, and PRs - in
those contexts, we try to be "egoless" in the sense that we're describing
what the code does, not describing our deep personal struggle to find a
solution to something.
—
Reply to this email directly, view it on GitHub
<#3473 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BRODAIYSOS3QXNFKEXYV2WD27NCEVAVCNFSM6AAAAAB5PDWHZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQOJUHA2TCOJYGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Hi! I'm not sure what's going on in the testbed and I'm not sure why the widget isn't showing on an actual Windows machine with Python 3.12 (I packaged it by running python -m build in all relevant directories and put it onto the Windows machine and used pip (using python subprocess, we don't have command line) and --no-deps to install toga, toga-core, and toga-winforms) either... I tried a couple of things like making visible = true and also using autosize as sizemode at init but nothing shows. I'm using |
|
I can't think of any obvious reason either - but I don't have access to a Windows test box, so I won't be able to provide any help until I'm back in my office early next week. |
|
Thanks. Any tips on debugging those things |
|
Not really; it depends entirely on what behaviour you are (or aren't) seeing. In this case, is this image being added at all? If you use a different (static) image, does it work? If you change background colors, can you see the outline of the image? |
|
Different static image did not work if I remember correctly. |
freakboy3742
left a comment
There was a problem hiding this comment.
AFAICT, the issues you're seeing with testing are entirely caused by the handling of visibility logic.
|
Thanks! As someone who does math... you'd expect me to be very good at logic... |
|
OK so GIF cannot have partial transparency... higher resoltuion does not seem to fix the problem... Should I leave it like this? |
|
OK So I've used ChatGPT to generate a script to do this, is there anything obviously wrong with it? Probably, but it seems to work with the latest releases. I will try to learn pillow properly tomorrow... but in the meantime I'm trying to work on a CPython issue which will take the rest of my available time today. |
I won't profess expertise in Pillow - but honestly, I'm a little surprised it's that complex - especially with regard to re-cropping frames. The other thing is that we probably don't want to save it to a file - we want to keep it in-memory, stored in a cache against different background colors (so we only generate one image in the simple case). Or, we could generate one anti-aliased image against the default Windows background color, and leave this as a known issue. |
|
Great. Of course, ChatGPT is Almost Always Wrong (AAW (tm) :)) ("))" looks so imbalanced), so let me learn pillow a bit further tomorrow. On the other hand my ability to contribute is severely limited... I didn't even know lstrip and rstrip exists, and someone pointed it out on py/cpy and got 3 laugh responses... |
|
Also we can save it to a temp file convert it into a Winforms bitmap and delete the on disk file |
|
HOLD ON.... I found the bug When using convert I believe the PDF is first rasterized at a fixed size and THEN scaled. If you do e.g. 1024x1024 the output will essentially become minecraft. I used \scalebox in LaTeX to increase page size (=initial "resolution" for ImageMagick) but realized I used preview for tikzpicture and not around the scalebox Scrub everything in this thread, and will retract all releases from the repo immediately after I finish fixing. |
|
In other words, higher resolution works, and ALL of this is an error on my end. I apologize for causing you all the sleeplessness and trouble, if any. |
|
OK now let's make the spinner thicker. |
|
Still looks just a little jagged when the zoom is at 100% but it's good for anything above... but it's acceptable for now. |
freakboy3742
left a comment
There was a problem hiding this comment.
This is getting pretty close; I think we're down to the last pieces of cleanup and internal documentation.
johnzhou721
left a comment
There was a problem hiding this comment.
For my own benefit.
|
FYI: It says EDIT and also thanks for handling my DPI concerns and for untangling my spaghetti and for understanding why I'm caching the size! |
|
Yeah - not sure what is going on with Github. I think this is ready to land... but I need to see CI first. |
|
Hmm... Should I close this and open a new PR with this exact same branch? |
|
Doing the above since 23 minutes already passed... ironically the processing updates is displayed as a spinner which is what we're trying to add here. [pun b/c if I just hit close it'd send an email anyways] |
|
@freakboy3742 It's good now. |
|
CI Pass! |
|
Sounds intermittent. |
|
I can re-run Ci on a single task if there's an intermittent failure. You don't need to push a blank commit. |
|
OK so I removed the latest commit in hopes of the commit will stop eating CI resources but turns out the last commit was re-run which wasted even more CI... sorry... |
freakboy3742
left a comment
There was a problem hiding this comment.
Looks like that does it - time to merge!
|
Thanks for working me through this! Sorry for wasting your time on errors in spinner-anim.
Yak shaving... correlates well with the mascot. :)
EDIT (sent early) we're seeing 103 checks because both runs associated with that commit got counted... Potential bug in GitHub. |
|
@freakboy3742 Sorry for commenting on a closed ticket, but should the default background color be transparent? |
Yes - all widgets start with a background color of |

PR Checklist: