Paint events don't always refresh on Catalina

  1. ‹ Older
  2. 7 weeks ago

    Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    I'm refactoring taking into account Trixi's class and another version of this same code that doesn't exhibit the issue on Catalina.

    It's just very odd that the problem doesn't manifest on any platform BUT Catalina.

  3. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    @Beatrix W Can you try to run the code? http://www.mothsoftware.com/downloads/tabbar.zip

    Interesting that you're actually doing the same thing that I'm doing, just you've created a class that is reusable and mine is fixed and dependent on the number of tabs I physically code.

    As I mentioned to Sam above, I've also tried drawing my icons in the primary canvas, but in that case, I then lose the icon, as well.

    However, in extending what I was writing to System.Log in the Paint event and my MouseUp event, I see something very odd - the index in the Paint event when called AFTER the click is always 0 instead of the Canvas clicked:

    1:09:16 PM : ccMainTools.cvToolButton.MouseUp: Index is 1, tbIndex is 1
                 ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 1
    1:09:18 PM : ccMainTools.cvToolButton.MouseUp: Index is 2, tbIndex is 2
                 ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 2
    1:09:19 PM : ccMainTools.cvToolButton.MouseUp: Index is 3, tbIndex is 3
                 ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 3
    1:09:20 PM : ccMainTools.cvToolButton.MouseUp: Index is 4, tbIndex is 4
                 ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 4
    1:09:21 PM : ccMainTools.cvToolButton.MouseUp: Index is 0, tbIndex is 0
                 ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 0
  4. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    Here's a simple one-window project that I created in 19r3.1 to test this. Do any of you see what I'm missing?

    TabTestCatalina

    As before, it works as expected on all platforms except Catalina.

  5. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake

    I think I see what the issue is but I'm not on catalina right now

  6. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    @Norman P I think I see what the issue is but I'm not on catalina right now

    C'mon, give! Is it a Tim-oops, or something else? I'm slowly going bald here :D

  7. Scott C

    Feb 11 Pre-Release Testers, Xojo Pro twitter.com/ScottCadillac
    Edited 7 weeks ago

    I don't know much about Control Sets, but I do see the visual difference on Catalina you describe Tim, verses what I see on Mojave.

    One observation I noticed, is the log on Catalina only outputs the following when I click on the "Data Manager" tab (for each OS):

    ccMainTools.cvToolButton.MouseUp: Index is 3, tbIndex is 3
    ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 3

    Whereas on Mojave I see:

    ccMainTools.cvToolButton.MouseUp: Index is 3, tbIndex is 3
    ccMainTools.cvToolButton.Paint: Index is 0, tbIndex is 3
    ccMainTools.cvToolButton.Paint: Index is 4, tbIndex is 3
    ccMainTools.cvToolButton.Paint: Index is 3, tbIndex is 3
    ccMainTools.cvToolButton.Paint: Index is 2, tbIndex is 3
    ccMainTools.cvToolButton.Paint: Index is 1, tbIndex is 3

    Does that help?
    Edit to add: So more occurrences of the Paint event on Mojave with each click?

  8. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    Yes - and it explains exactly what I see. All of the controls in the array are not repainted under Catalina. So, that looks like a Xojo thing. I feel much better now.

    It appears that I'll need to force a refresh of each member of the control array on MouseUp to get it sorted on Catalina.

    Thanks, Scott!

  9. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake

    All I did was override both implementations of "Invalidate" and then have them actually invalidate each of the componenets
    And got rid of refresh in favour of invalidates
    And then booted into ccatalina to test it and it seems to work exactly as desired
    http://great-white-software.com/miscellaneous/Screen%20Recording%202020-02-11%20at%201.46.27%20PM.mov

  10. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    Yuuuupp! That got it. Adding the loop to call cvToolButton(i).Invalidate for each member of the array in the MouseUp fixed it.

  11. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake
    Edited 7 weeks ago

    here's my mods

    http://great-white-software.com/miscellaneous/TabTest.zip

    FWIW it did misbehave here on 10.14.6 which is where I first made the changes

  12. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ
    Edited 7 weeks ago

    So, the moral of the story is - Don't depend on a Control Array's Paint event to update all members unless you manually force the refresh.

    Here's my modified code in the MouseUp event:

    tbIndex = index
    System.Log(System.LogLevelDebug, CurrentMethodName + ": Index is " + Str(index) + ", tbIndex is " + Str(tbIndex))
    
    ToolButtonClicked(index)
    
    For i As Integer = 0 to 4
      cvToolButton(i).invalidate
    Next

    I was just lucky with the way the Refresh works on the other platforms.

  13. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake
    Edited 7 weeks ago

    there's no reason for it to update them all if they havent been invalidated

    whether its a control set or individual controls really doesnt matter in this regard

    the only thing a control set is saving you is writing the same code in the event handlers multiple times but even that is easily handled with individual controls (just use a method and pass each instance into the method on the form/cc/ etc)

  14. Tim S

    Feb 11 Pre-Release Testers Canterbury, UK

    So what is it that's going on, then? It's still unclear to me what the remedy is. I have a similar sounding issue on Linux, where the paint events for a control set don't fire at all.

  15. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake

    not everything was being invalidated that needed to be

  16. Tim J

    Feb 11 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    So - that it worked on the other platforms since 2005 is a complete mystery???

  17. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake

    Or something changed at some point but I dont recall that ever happening

    Containers have always bee a tad odd in how they handle invalidate & paint
    I dont recall either being automagically propagated to the controls they contained - you pretty much always had to, or should have, done it by hand
    That way you could selectively update whatever was contained and NOT get tons of items repainted when maybe you only needed on repainted (or none - and just the containers background redrew)

  18. Sam R

    Feb 11 Pre-Release Testers, Xojo Pro, Third Party Store Hengchun, Pingtung, Taiwan

    @Norman P Containers have always bee a tad odd in how they handle invalidate & paint

    You can say that again, and again, and again, and again...

  19. Norman P

    Feb 11 Pre-Release Testers, Xojo Pro outside avoiding snowflake

    when in doubt do it yourself :)
    I've pretty much always manually done something like overriding the invalidates in a container just to make sure what I want is invalidated and so gets redrawn as I expect

  20. Hi there,
    why don't you take tab panels
    is very simple
    I use emoji for the lettering
    is small but quite
    and you can put lots of objects on the pages

    https://www.dropbox.com/s/fm2kytfkwxl2slx/Tab-Panel-test.xojo_binary_project?dl=1

  21. Tim J

    Feb 12 Pre-Release Testers, Xojo Pro N. Phoenix, AZ

    @Rudolf J Hi there,
    why don't you take tab panels

    Because I want consistent design and appearance on all 4 platforms - Linux, Pi, Windows, and macOS.

or Sign Up to reply!