Re: Strange NSScroller sizing behaviour
Re: Strange NSScroller sizing behaviour
- Subject: Re: Strange NSScroller sizing behaviour
- From: Bill Appleton <email@hidden>
- Date: Fri, 30 Apr 2010 11:19:22 -0700
hi anyone out there,
i have more information on this scroll bar bug
if i open more and more text windows the scroll bar (nsscroller) appears on
the right or bottom of each one
each window has 2 scroll bars, i have verified the 2 sub views, but only one
can appear at a time
i can't find any graphics clipping problems or something like that
i have looked for something that tells the scroll bar to be vertical or
horizonta but can't find it, i assume it looks at the width or height & just
does that automatically
i think i can see a horizontal bar stuck in a little piece of the vertical
slot, and a vertical bar stuck in the horizontal slot
the slots are correct in size, but the bar hasn't re-jiggered to fit the
slot
does anyone know what is going on?
thanks,
bill
On Thu, Apr 29, 2010 at 12:08 PM, Bill Appleton <
email@hidden> wrote:
> hi Jo,
>
> i am also working with NSScroller directly
>
> i have two types of windows
>
> in one type, the vertical bar appears and the horizontal bar is missing
>
> in the other type, the opposite situation occurs
>
> i am sure they are set to the right bounds, etc. and visible
>
> have you looked at NSControl
>
> calcSize and sizeToFit?
>
>
> thx
>
> bill appleton
>
>
>
>
>
>
>
>
>
> On Thu, Apr 29, 2010 at 4:59 AM, Jo Meder <email@hidden> wrote:
>
>> Hi,
>>
>> I'm using NSScrollers directly, e.g. not in an NSScrollView. Using 10.6.3
>> (haven't checked anything else mind you) I'm seeing some strange behaviour
>> when I try and resize them. I have code similar to the autosizing stuff in
>> Cocoa/IB which, for example, resizes controls as a window resizes. I noticed
>> that NSScrollers didn't seem to be resizing properly and were falling behind
>> the size they should be. This is the function I use to set the width of a
>> control:
>>
>> void UCMacControlImp::SetWidth( const SInt32 theWidth )
>> {
>> NSRect frame = [m_nativeControl frame];
>>
>> [[m_nativeControl superview] setNeedsDisplayInRect:[m_nativeControl
>> frame]];
>>
>> frame.size.width = floor( ( CGFloat )theWidth );
>> [m_nativeControl setFrame:frame];
>> [m_nativeControl setNeedsDisplay:YES];
>>
>> return;
>> }
>>
>> What I noticed in the debugger was that the frame of the NSScroller
>> occasionally wasn't changing to what I set it to. For example if theWidth
>> was 586 and the frame width at the time SetWidth() is called is 585 then
>> after the setFrame: message the width of the frame would still be 585, not
>> 586. This doesn't happen all the time, just occasionally, but it's enough
>> for the width to get out of sync with what it should be. When the correct
>> thing does happen I see the values update as expected in the debugger.
>>
>> In my test app I have an NSButton in the same window but that stays
>> perfectly in sync as it's resized. I also haven't noticed problems with any
>> other views, which I use plenty of, it just seems to be NSScrollers. The
>> problem occurs in both 32 and 64 bit builds.
>>
>> Originally I was using setFrameSize: but that also had problems.
>>
>> Does anyone have any ideas about what might be going on?
>>
>> Regards,
>>
>> Jo Meder
>>
>> _______________________________________________
>>
>> 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
>>
>
>
_______________________________________________
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