Apparently this is Cocoa, as it doesn’t happen with Carbon. I have xojo 2013r4.1. When I switched to Cocoa these buttons started disappearing and being cut off. This code is the windows resized event handler:
Dim sze As Integer = self.Width
ProcessButton.Left = sze - 110
DelRowButton.Left = (sze/2) - 50
The DelRowButton when I maximize the window disappears from the screen, but reappears when it returns to original size, but its right side is cut off.
The ProcessButton appears correctly when maximized, but when returned to original its left side is cut off, but will return sometimes if maximized.
Am I missing something like I now have to unlock the controls? That wasn’t the answer. Suggestions?
I just copied your code and placed two buttons on a window as an example and it appears you are right. If you add the exact same code to the “Resizing” event as well as (or instead of) the resized event, however, the problem goes away and it behaves as expected.
Thanks, but goes away. I’m not sure what you mean?
Copy the code in your resized event and paste it into the resizing event. You need it in both for it to properly update.
Sorry. I missed the ‘ing’. It’s not in the LR. Is this something particular to Cocoa?
No, it’s an event on the window continuously fired as the window is changing size (resizing). It you want controls to appear to animate while a window is changing size you put the code there. I can put a quick example together if you want me to.
There seem to be some control redraw problems in connection with their containers resizing. I have one listbox underneath one window and, if its needed, resize the window to show it (in other words, I expand the window.height with a smooth resize).
Everythings fine so far, and it works in both ways.
I used to have a MacOSLib.Listbox here first, but once the window was shortened and “opened up” again, some elements seemed to receive incorrectly calculated positions and wandered away into the unknown. I tried some refresh- and recalculate-events, but nothing helped.
With the Xojo.Listbox this does not happen anymore, but the listbox can be changed from showing one column only (without header) to 5 columns (with headers). This works, but only until I resize the width of the window. Once I change then from 5 to 1-and back to 5 columns, the headers will not be shown until I resize the width manually again. Instead of them the first line of the 1-column-view stays in place. Refreshing on resized event doesnt help.
Thanks Jason. I understand now about resizing, but I never needed it before. I think this is a bug