Window resizing event

Hello

this code in the resizing-event of a window…

dim h as integer info.Text=str(me.Height) if me.Height>700 then MsgBox ">700" end if

why does the info label gets updated live but the messagebox never show up when window is higher than 700?

It should do, at least it does here, that’s pretty straight forward stuff so it should work as expected.

Also what OS & version of Xojo are you using?

A couple of things to check are, how you open the window, that Type is the window, have you altered any of the default inspector settings on the window?

Are you able to break out this issue into a small test project that you can share?

yes i thought that, too.
os x High Sierra, Xojo 2017r3

i did:
-new project
-added resizing event to the default window
-placed the above code

info label gets updated, msgbox never shows…

placing this code in a resized-event does show the msgbox when resized finished, but not in live resizing…

if you only want to limit the window Height, set the window max property to 700 abnd forget the msgbox.

Edit:
Click in Window1,
in the Properties pane (right), set the Max. Height field to 700.

no, thats of course not me intention, i was just wondering why…

Is one of those things that works with Sierra but doesn’t work on High Sierra.

Those macOS changes. Hard to keep up.

Edit: Tested Xojo2017r3 and 2018r2 on macOS 10.12.6 and it works.

ok thanks! i didn’t thought this was system related…

In fact, using MsgBox is basically a bad idea. (Called from the Paint, LostFocus, Activate, etc. Events).

For testings, you can either change the window Title contents (Self.Title = ">700") or:

System.DebugLog ">700"

Remember to click in the System icon (bottom, centered / right icon).

No problem. I was hit with a system related change and after that I’m seeing more and more about this. There are bugs reported to Xojo for things that works Ok in Sierra/High Sierra and don’t work in Mojave, others that work in Mojave but doesn’t work in Sierra/High Sierra. This works in Sierra but not in High Sierra/Mojave. One of my bug reports were closed because I had an issue with Sierra, Xojo team were not able to reproduce it, maybe because later I found out it works ok in High Sierra and Mojave.

My guess is that Apple changed this because a Resizing event should not stop the resizing. A MsgBox will a) stop the resizing and b) change the focus to something else.

You can use MsgBox on Resized event. If you think about this it makes sense.

Note: even when this ‘works’ in Sierra, the window turns black when the MsgBox is shown. It’s not pretty and the user may think something is wrong with the software. Maybe that’s why Apple changed how things work.