Hi

I want to put a child window over the top of one of my views. I have a few 
nested RBSplitViews and I want to get the origin of the contents of one of 
those split views, but no matter what I do, it seems to come up with strange 
results.

I have "scrollView" as a subview of one of the RBSplitSubviews:

NSPoint windowPoint = [scrollView convertPoint:[scrollView bounds].origin 
toView:nil];
NSPoint screenPoint = [[self window] convertBaseToScreen:windowPoint];
NSWindow *childWindow = [[NSWindow alloc] 
initWithContentRect:NSMakeRect(screenPoint.x, screenPoint.y-150.0, 150.0f, 
150.0f) styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered 
defer:NO];
...

This puts the child window above the top of the scrollview by about 20 pixels. 
The X edge is at the left edge of my Window, which is where it should be in 
this case.

I also have another RBSplitSubview beside the first, so I thought I would try 
with that and see what would happen. It ended up at the left edge of my window 
(which in this case is wrong), and half way off the bottom of the window - 
nowhere near where it should be.

Has anyone else experienced strange results from these methods?

Could the split views be messing things up?

I also tried using convertPointToBase, but the results were the same (I'm not 
sure if there is a difference between convertPointToBase: and 
convertPoint:toView:nil)


Thanks

Gideon

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to