ONE window in my project freezes both IDE and running app

There are numerous underlying differences between Monterey and previous versions. Probably due to the ongoing convergence with iOS.

You have no control over which system users will run in the future. Given the acceptance rates of macOS users, I would not bet on many users remaining with an older version for the sake of running my apps.

The path is clear: the only control you have over the issue is to adapt your app to Monterey. No offense, but over 250 controls on a window is probably not good UI design. Besides, some controls probably take more time to draw than others.

Time to refactor your window, probably breaking it into several.

You did not share the kind of controls you are using, but sometimes changing that can be a great way to go around. For instance, replacing separate canvases by a unique one and drawing pseudo controls into it allowed me recently to considerably speed up an app.

So I assume they are seeing this issue on Monterey also? Did they try it on Big Sur or earlier? That is what needs to be determined - what in Monterey is causing the issue. Only then can you/they attempt a workaround.

1 Like

Xojo feedback said that ā€œYou didnā€™t specify, but it looks like WindowDollarValue is the window that is causing problems? I clicked on it and the IDE did appear to hang for a while, but after 2-3 minutes this window did open.ā€ Given that they are probably using a faster machine, and that so far I have not felt it worthwhile sitting around long enough to get an accurate timing, thatā€™s consistent.

So what I am seeing, for this window and only this window in the IDE, is: about three SECONDS under Big Sur, maybe ten MINUTES in Monterey, and Xojo is seeing 2-3 MINUTES.

Iā€™m asking Xojo feedback to try it with Big Sur. If they see seconds under Big Sur and minutes under Monterey perhaps they will judge that thereā€™s something more here than an idiot user stuffing too many controls into a window.

I can cut large number of controls out of the offending window WITHOUT any obvious improvement in opening time. I have a ā€œfeelingā€ it has something to do with control sets.

Iā€™d be glad to send the project to anyone interested in helping me out.

Of course Iā€™m going to refactor the window using containers because at this point Iā€™m stuck on anything else to do. I donā€™t want to get too defensive but why yes I do know how to troubleshoot, it is a slow process when something as simple as ā€œcut a group of controls from the window and paste them into a containerā€ involve a 5-10 minute delay every time! It takes a day to do as much experimentation as Iā€™d expect to do in fifteen minutes. This is a personal toolā€“in fact I hardly need to build the app at all, I usually just run it from within the IDE. I never even noticed that the Mac Lite version doesnā€™t support text export-import, because I never wanted to use it before. Iā€™ve been using Xojo for roughly TWENTY YEARS and I donā€™t remember when that capability was cut from the affordable version. No, Iā€™m not going to defend putting that much stuff in one window, but there IS a ā€œbugā€ and this should NOT be happening.

If you kept an older version of the system, perhaps you can do the editing under it, and then see what it does under Monterey.

I know some versions of the IDE slowed down when the IDE toolbar was visible. You could try hiding that to see if it helps.

I think Iā€™ve narrowed it down to Slider controls that have large PageStep (1000) and MaximumSize values (20000). It appears that the drawing of those on Monterey is much slower than before. Dropping them down to more reasonable values (10 and 2000) gets speeds back to what they were before.

8 Likes

Yes. Thatā€™s it.

I can live with a restriction of page step 10 and maximum size 2000. For my purposes, the problem is solved. And I solemnly promise everyone that Iā€™ll refactor the window using Collections, but in my defense that was not the source of the problem.

Thank you, Paul Lefebre.

Paul, have you filled a Feedback case - is it even appropriate in this situation?

I havenā€™t used the slider much, but in the case of a progressbar, conventional wisdom is to set the max at the actual width of the bar and calculate a percent of completion (which yields the number of pixels drawn) and only update the progressbar when the value changes. Would that apply to a slider, but in reverse?

Daniel created a case (it is private), which I have kept open. Although this is a macOS bug (I also saw it mentioned on the GitHub page for OpenCV), it might be worth limiting the range (or scale) if tick marks are enabled.

Well in any case, the number of ticks should not be higher than half the width of the control and the max value shouldnā€™t be higher than the width.

Huh? Sliders routinely allow you to choose values that are wildly larger or smaller than the controlā€™s physical width or height.

Because you can do something, does not mean you should :smiley:

While you can, you donā€™t get any benefit. Being able to set a sliders value from 1 to 20000 on a control thatā€™s 200 pixels wide means the user can only ever select 100, 200, 300 by sliding in 1 px increments. As it is, the default NSSlider uses 0.0 and 1.0 for min/max and itā€™s up to the developer to scale the value.

Ticks are worse. Setting them to anything higher than Ā½ the width means that ticks are essentially turned off because they are so close together.

1 Like

Victim here, I think some of you are blaming the victim. To begin with, Iā€™m not quite sure I know how to determine the exact number of pixels of the length of the sliderā€™s travel (as opposed to the length of the control). But, second, if there were some great accepted principle that the sliderā€™s maximum value should always equal the pixel length of the sliderā€™s travel, it would be perfectly easy to design the control so that the value was unscaledā€“just the raw pixel distance. Thereā€™s no reason to provide a maximum value parameter at all. Itā€™s only a convenience feature: the control is intentionally designed to do the scaling for you. If youā€™re not ever supposed to do scaling, why provide the feature?

Iā€™m not sure what Greg O is suggesting here. I had them set at a spacing of 100 and a max value of 20,000. The sliderā€™s about 400 pixels, so thatā€™s 20 pixels between ticks. Thatā€™s not at all useless.

I have it set so high because I am trying to get reasonably close to a continuous readout and set a real (not integral) value, and I want it to be high enough that the increment is determined only by pixel resolution. 20,000 is overkill, but itā€™s also harmless. The control allows it, and it works perfectly well under Big Sur, both in the IDE and at runtime. If I were displaying 5,000 ticks I would agree that that is somewhat abusive and might expect some bad behaviorā€“in fact you donā€™t, Iā€™ve done that accidentally! But a many-minute freeze-up in the IDE without any warning message is not good ā€œUIā€ on the part of the IDE designer!

Anyway, if this is truly a macOS bugā€“i.e. it happens if you build the same kind of slider in Swift or Objective C or whatever is the Apple language du jourā€“Xojoā€™s responsibilities are pretty limited. Iā€™m not even sure what I think they should do.

Good programming is about being pragmatic.

The user will never see more than one pixel move.