TreeCtrl with handler to print selection changes; button to delete current selection.
Works as expected on MacOS (10.12.6): deleting a node generates selection change.
On Windows (tried Win 7 and Win 10) it looks correct, and GetSelection() reports correct new value, but no change event generated.
wxPython 4.0.0b2
Is this an issue with native control, wxwidgets, wxpython, or my code?
Thanks so much!
-ck
···
#!/usr/bin/python
why don’t I see selection event after delete on Win?
TreeCtrl with handler to print selection changes; button to delete current selection.
Works as expected on MacOS (10.12.6): deleting a node generates selection change.
On Windows (tried Win 7 and Win 10) it looks correct, and GetSelection() reports correct new value, but no change event generated.
wxPython 4.0.0b2
Is this an issue with native control, wxwidgets, wxpython, or my code?
Interesting. It works with wxPython 2.8.12 on Windows, but not wxPython 4.0.4.
There has always been a debate over whether changes triggered by the application should fire events. Intuitively, it seems like this should fire an event, but it is debatable.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
On Wednesday, June 19, 2019 at 10:24:48 AM UTC-7, Tim Roberts wrote:
Charley Khan wrote:
TreeCtrl with handler to print selection changes; button to delete
current selection.
Works as expected on MacOS (10.12.6): deleting a node generates
selection change.
On Windows (tried Win 7 and Win 10) it looks correct, and
GetSelection() reports correct new value, but no change event generated.
wxPython 4.0.0b2
Is this an issue with native control, wxwidgets, wxpython, or my code?
Interesting. It works with wxPython 2.8.12 on Windows, but not wxPython
4.0.4.
There has always been a debate over whether changes triggered by the
application should fire events. Intuitively, it seems like this should
fire an event, but it is debatable.
Thanks for trying it out. Given that the behavior changed even between versions of wxPython - should this be filed as a bug?
It was okay the way you did it before. As long as the code in the message is formatted properly so the lines don’t wrap, and you don’t lose leading whitespace, it is fine. I think the groups software and/or email applications have figured things out there now.
Sorry I totally missed the guideline about attaching code instead of inlining - same snippet attached here, too.
My next question is – say this is just a quirk of the platform I need to work around – what is the best way to do that?
I can’t just call tree.SelectItem() – it does nothing, because as noted below, the selection is in fact correctly set, so that call is a no-op.
Is it on me to call my handler directly for Windows in this case?
It might be able to be back-ported to wx 3.0, but I don’t know if there will be another wxPython 4.0.x release. Probably not, if 4.1 progresses to a release in the next couple months or so.
···
On Wednesday, June 19, 2019 at 4:50:26 PM UTC-7, Charley Khan wrote: