Carbon apps and RightZoom

The RightZoom application:

link text

resizes your application window to fill the screen using keyboard hotkeys. Works fine with Cocoa apps. Unfortunately, with Carbon apps the window is resized, the Resized event is fired, but the controls on the window do not resize/reposition themselves until the window is manually or programmatically resized.

Anyone have a suggestion on how to handle this?

(and, no, recompiling for Cocoa is not currently an option)

Don’t use RightZoom since its not doing something “right” :stuck_out_tongue:

Well it’s not the only software that has this effect. BetterSnapTool (apparently) shows the same issue:

BetterSnapTool

I understand that it’s probably a carbon thing, but I was hoping someone might suggest a simple workaround.

can you not just intercept the windows MAXIMIZE event, and control things yourself?

The Maximize event doesn’t fire.

The only workaround I can think of is to check the size of the window after a Resize and if it is “maximized” then programmatically adjust the size of the window by -1 pixel and then +1 pixel to force a proper resize/redraw. However, that smacks of kludge to me.

Sub Resized() if me.height+22 = screen(0).AvailableHeight and me.Width = Screen(0).AvailableWidth then me.fullscreen = true end if End Sub

Works fine in Cocoa and Carbon.

Thanks for that, but the software mentioned above doesn’t only maximize windows - it can also tile them, etc.

Would be interesting to know HOW it does what it does and hence why its resize doesn’t trigger a resize event

It does trigger a Resize event, but any controls that are, say, locked to the sides of the window do not resize or move.

Well as Norman stated in another post, you might as well start working now on Cocoa instead of waiting until Apple kills Carbon and then you frantically have to update everything all at once.

I think this comes down to how Xojo creates and initializes an app window is correct, but not common, code.
Anything that expects something specific may not function as intended.
I don’t know if RightZoom is such a thing.

We know of one other item related to Carbon that has to do with how we initialize a window but this that other one are unlikely to ever get any attention since they’re not show stopping bugs (i.e. outright crashes)

We’re basically following Apples lead and unless it crashes an app outright it won’t get fixed - esp since you say it functions correctly in Cocoa.

The advice would be - make it a Cocoa app,

[quote=108872:@Paul Rodman]Anyone have a suggestion on how to handle this?

(and, no, recompiling for Cocoa is not currently an option)[/quote]
I had this before with a tool called Moom (which is awesome), my best guess is that it’s designed to work with NSWindow, which Carbon most likely doesn’t use.

if the resized event doesn’t fire when the tool resizes the window, the only suggestion I have is to try to capture the events or messages (Although I don’t think carbon uses a messaging system like Cocoa). Which probably requires the MBS or a bunch of declares.

What ever you do, don’t be tempted to throw a timer on the window and check to see if it’s been resized, this is very energy inefficient and is a cheap hack at that.

Your best bet, which may be a bit of work right now, is to try to move to Cocoa. Post any questions to this forum and we’ll try to help, any errors or crashes to Feedback so that Xojo can fix 'em. Holding out with Carbon, is like sticking with a car that’s done 300,000 miles and you can’t buy new parts for.

Sorry if you looked for something else but I could not guess. I tried to reply to your original post, where you asked specifically for a way to fill the screen and noted that you could not do that through the Resized event, and later on said Maximize did not fire. Now if you want to do something else, you should express it more clearly. Emulating a particular software is never difficult when one knows what he actually wants.

[quote=108872:@Paul Rodman]resizes your application window to fill the screen using keyboard hotkeys. Works fine with Cocoa apps. Unfortunately, with Carbon apps the window is resized, the Resized event is fired, but the controls on the window do not resize/reposition themselves until the window is manually or programmatically resized.

Anyone have a suggestion on how to handle this?[/quote]