Re: Baffling Button Behavior
Re: Baffling Button Behavior
- Subject: Re: Baffling Button Behavior
- From: Keary Suska <email@hidden>
- Date: Mon, 19 Apr 2010 14:05:30 -0600
On Apr 19, 2010, at 10:02 AM, email@hidden wrote:
> Per Fritz suggestion / request:
>
> (gdb) po sender
> <NSButton: 0x115efb0> <<= Save Button
> (gdb) call (id) [sender superview]
> $3 = (id) 0x1183540
> (gdb) po $3
> <PlaceholderView: 0x1183540>
> (gdb) call (int) [sender autoresizingMask]
> $4 = 36 <<= NSViewMaxXMargin = 4 & NSViewMaxYMargin = 32
> (gdb) c
> Continuing.
> (gdb) po sender
> <NSButton: 0x1164030> <<= Save As Button
> (gdb) call (id) [sender superview]
> $5 = (id) 0x1183540
> (gdb) po $5
> <PlaceholderView: 0x1183540>
> (gdb) call (int) [sender autoresizingMask]
> $6 = 36 <<= NSViewMaxXMargin = 4 & NSViewMaxYMargin = 32
>
>
> Full window before containing view resized:
>
> http://highrolls.net/Before.png
>
> And after:
>
> http://highrolls.net/After.png
I believe it is doing exactly what you ask it too, but it appears that it is incorrect because *other* views are resizing in odd ways. Both buttons are anchored on the left, yes? Which means that the view will maintain that distance, which looks to me that it is. However, the "flag" image view has resized larger, while the table view became shorter. This change is making it seems as if the "Save As" button is keeping its right margin, when in fact it is purely accidental.
But then in fact it is the *left* button that isn't behaving properly. But this may be because autoresizing becomes undefined any time sibling view overlap, and you may be running into this issue.
Of course, I am assuming that all of the views int the right pane of the split view have the same superview.
It may be useful to first solve why the image view and the scroll view above it aren't resizing in an expected way.
> On Apr 18, 2010, at 2:24 PM, Fritz Anderson wrote:
>
>> On 17 Apr 2010, at 4:32 PM, email@hidden wrote:
>>
>>> I have two buttons in a view, side by side. Their autoresizingMask are both NSViewMaxXMargin + NSViewMaxYMargin
>>>
>>> When their containing view is resized only the left button behaves properly. The right button stays fixed.
>>>
>>> Why?
>>>
>>> Before resize:http://highrolls.net/Before Resize.png
>>>
>>> After resize:http://highrolls.net/After Resize.png
>>
>> I wish you had provided the real URLs (e.g. <http://highrolls.net/After Resize.png>).
>>
>> I also wish your screen shots showed the enclosing window, so I could tell what resizing was done. Group: There are two buttons visible, "Save" on the left, and "Save As…" on the right. In the "before" picture, they appear side-by-side, with a normal amount of space between them. In the "after" picture, which I _assume_ comes after the window was resized to be narrower, "Save" (left) is the same x-distance from the left margin (visually stationary); "Save As…" (right) has moved to the left so it is under, and half-covered by, "Save."
>>
>> The most obvious explanation is that the resizing mask for "Save As…" contains NSViewMinXMargin (flexible on left) and not NSViewMaxXMargin (flexible on right), despite your intention.
>>
>> Things to try:
>>
>> I would like to see your code in which you set the autoresizing masks, for both buttons. Or if it was done in Interface Builder, please double-check the resizing settings.
>>
>> Verify that the two buttons are embedded in the same view.
>>
>> In the debugger, set a breakpoint in some code where you have access to pointers to the two buttons, after their resizing masks have been set. If you really are using setAutoResizingMask:, breaking right after the second call would do. Then use the Debugger Console for these two commands:
>>
>> p/d (int) [saveButton autoresizingMask]
>> p/d (int) [saveAsButton autoresizingMask]
>>
>> My bet is the two numbers are different.
>>
>> — F
>>
>>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden