LiveCode 10.0.1 rc-1

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
j9v6
Posts: 85
Joined: Tue Aug 06, 2019 9:27 am
Contact:

LiveCode 10.0.1 rc-1

Post by j9v6 » Sat Oct 19, 2024 1:36 pm

Hi All,

Not sure if anyone else is trying out 10.0.1 rc-1 but I am. So far it all works well, and being able to build for iOS without having to jump through hoops with the Xcode version is great. Maybe we'll get the same 'no jumping through hoops' for Android too - wouldn't that be nice.

The only issue I've found in 10.0.1 rc-1 so far is that the systemAppearance value is not always being returned in the IDE, so I'll get light and dark most of the time and occasionally I get blank (empty).

Running macOS Sequoia 15.0.1 on Apple Silicon. Desk & macBook is facing East-North-East, weather is sunny and I've got size 11 boots on (well, you never know what can affect systems these days).

Anyone else able to reproduce or is it just my setup?

Edit: If I open my stack in 9.6.13 I can swap from light to dark mode without any hiccups and systemAppearance always seems to return a value to the IDE.

Al.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4106
Joined: Sun Jan 07, 2007 9:12 pm

Re: LiveCode 10.0.1 rc-1

Post by bn » Sat Oct 19, 2024 11:24 pm

Hi AI,

I tried to recreate the problem you describe.
What I found is when I put an "systemAppearanceChanged" handler into the stack script to the example code from the dictionary:

Code: Select all

on systemAppearanceChanged
   local tName
   put the short name of the owner of the owner of me into tName ## this is a button script
   if the systemAppearance is "dark" then
      set the backColor of stack tName to "black"
      set the foreColor of stack tName to "white"
   else
      set the backColor of stack tName to "white"
      set the foreColor of stack tName to "black"
   end if
   pass systemAppearanceChanged
end systemAppearanceChanged
It works when I start up the stack. This seems to hold if the sample stack is opened as the last/only stack.
As soon as I create a new stack the stack script does not work anymore.
"systemAppearance" always reported the correct setting. (I made a script that queries "systemAppearance" every second and it always returned the correct setting.)

I came up with the idea to trap the "systemAppearanceChanged" message in a front script and that worked regardless of newer open stacks or not.

On mobile you probably have only one stack and there is nothing to interfere. (just a guess)

For the specifics of your stack one probably would have to adjust this.

Kind regards
Bernd
Attachments
SystemAppearanceButtonIntoFront.livecode.zip
(1.12 KiB) Downloaded 304 times

j9v6
Posts: 85
Joined: Tue Aug 06, 2019 9:27 am
Contact:

Re: LiveCode 10.0.1 rc-1

Post by j9v6 » Mon Oct 21, 2024 10:07 pm

Hi Bernd,

Thanks for your testing and letting me know what you get. It's certainly a weird one. It is consistently intermittently failing, so I'm not sure what's going on apart from suspecting it's a bug.

In my stack I have an on systemAppearanceChanged handler that dispatches setCardTheme to the active card. The setCardTheme handler queries systemAppearance to see if it's light or dark and then sets the colour palette for the card accordingly. It's this check of the systemAppearance that's returning an empty value from time to time... but only in the IDE. I suspect it will work flawlessly when deployed to iOS or Android. As mentioned in my original post, it works fine all the time in 9.6.13 IDE but intermittently fails in 10.0.1 rc-1 IDE. It's not a show stopper if you know about it as you can fudge it in testing to make sure the colour switching works.

Thanks again for your insight and pointers though.

Al. :)

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4106
Joined: Sun Jan 07, 2007 9:12 pm

Re: LiveCode 10.0.1 rc-1

Post by bn » Mon Oct 21, 2024 10:47 pm

Hi Al,

Sorry to hear that. Maybe you can track this down,

I made a small stack that checks for systemAppearence every second and counts if systemAppearence does not report a value.

this is the script of a button in a stack with two fields (name them as in the script of the button.

Code: Select all

local sCheck
on mouseUp
   if sCheck then
      put false into sCheck
   else
      put 0 into field "fCountFailures"
      put true into sCheck
      checksystemAppearance
   end if
end mouseUp

on checksystemAppearance
   local tAppearance, tBackClr
   if not sCheck then exit checksystemAppearance
   put the systemAppearance into tAppearance
   put tAppearance && the long time into field "fAppearance"
   if tAppearance is empty then
      beep
      add 1 to word 1 of field "fCountFailures"
   end if
   send "checksystemAppearance" to me in 1000 millisecond
end checksystemAppearance
It works for me in 10.0.1 RC without a hitch.
Maybe you can let it just run along with your other stacks in the IDE.

Kind regards
Bernd

Post Reply

Return to “Mac OS”