Window width/height not updating under Cocoa during resize

Under Cocoa I’m trying to use a window’s changing width and height to update some controls on that window from the window’s resizing event. It seems, however, that the width and height don’t update until after the resize is completed (mouse button released). This works under carbon so is it a bug in cocoa or expected behavior?

Sounds like a bug to me.

I thought maybe the Self.width and Self.height didn’t update while the resizing event was happening (even tho it updates under Carbon). I’m a bit surprised no one else has reported this. I checked the Feedback and didn’t see anything that sounded like what I’m seeing so I guess I should file a report?

There was a bug wherein the resize event wasn’t firing if you resized the window from the top of the window frame (a feature that is new to 10.7) but this was marked as fixed. Perhaps related?
https://xojo.com/issue/23694

Nope, the resizing event fires fine. It’s just that the window width and height aren’t being updated during the resizing event. The resize event is called once the mouse button is released at the end of the resize and the width and height are updated then.

OK, I wrote a small program to demo this “bug” and I’m finding that it’s working! … So it’s probably something about my specific app that’s causing the problem. I need to do more testing to find out what’s up! More to follow…

Shot in the dark: Any chance you’ve mixed up the Resized and Resizing events? Resizing fires during the resize, but Resized only fires once, at the end.

No, my code is in the resizing event. But I’ve discovered the problem, I think. It appears that Cocoa ignores the “Live Resize” setting in the window’s property list. It can be checked or not and live resize is still enabled. HOWEVER, if a statement like “Self.LiveResize = True” is in the window’s Open Event (for example), then Live Resize is DISABLED! So my problem was that I had a method that set Live Resize based on the user’s computer speed, etc. The act of doing that, and it actually doesn’t matter if it’s “Self.LiveResize = True” or “Self.LiveResize = False”, caused Live Resize to be disabled…

I did find an old Feedback report (#17324) that addresses part of this bug. It says:
“In the same application when liveresize is unchecked, carbon builds honor this setting and do not liveresize. I cocoa they still resize the window and controls as the windows size is changed.”

I’m attaching my “demo” file that shows this bug. Oops, can’t yet - getting an error related to file size…

Should I create a new Feedback report or add to #17324?

Trying to attach my demo .rbp file…

Getting a “server error.” Anyone know how to set “post_max_size” and “upload_max_filesize” to 5M ??? :wink:

Forum bug John. I tried to upload an small img (45kb) and it showed this error. Those and few other variables used to control uploads belongs to the PHP environment.

php.ini:

memory_limit = ?
max_execution_time = ?
upload_max_filesize = 5M
post_max_size = 5M

Thanks Ricardo. My file was even smaller (19KB) so I was pretty puzzled when it said “5M” (which I assume means 5 megabytes). :wink:

Hope it gets fixed soon… :slight_smile:

I filed a Feedback report yesterday - here’s the info:

Summary: Cocoa ignores window property list’s “Live Resize” setting but disables live resize if set programmatically
Link: <https://xojo.com/issue/26980>

Status has been set to “verified”

Wow! That was fast. Joe has posted on Feedback that this has been fixed and is awaiting verification from the testing staff!

Quick work, Joe. Especially since I’m sure you’re very busy right now! :wink: Thanks!

Joe is a box of surprises. :slight_smile: