Re: Baffling Button Behavior
Re: Baffling Button Behavior
- Subject: Re: Baffling Button Behavior
- From: email@hidden
- Date: Mon, 19 Apr 2010 10:02:38 -0600
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
Thanks for taking a look ... I hope I am not being to dense !
koko
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