Re: rolling my own drawer-like child window
Re: rolling my own drawer-like child window
- Subject: Re: rolling my own drawer-like child window
- From: Mike Wright <email@hidden>
- Date: Thu, 9 Oct 2008 16:40:47 -0400
On Oct. 9, 2008, at 10:17:23 -0700, Matt Neuburg <email@hidden>
wrote:
I want to make a drawer that the user cannot close or slide. Since
you can't
stop the user from sliding the drawer at least partially closed, I was
advised to use a child window instead.
Do you care if the user slides the partially closed, so long as it
doesn't stay there?
I just tried implementing the following in an NSDrawer delegate (a
custom NSWindowController), and it works pretty well for my purposes.
This is for a drawer at the bottom of the window, and the bottom edge
of the drawer doesn't even start to move until the mouse moves up
pretty close (some default distance?) to the bottom edge of the
window. When you let go of the mouse button, it pops back to its
original size.
It doesn't seem possible to drag it down at all.
- (NSSize)drawerWillResizeContents:(NSDrawer *)sender toSize:
(NSSize)contentSize
{
NSSize oldSize = [sender contentSize];
contentSize.height = oldSize.height;
return contentSize;
}
I also have - (BOOL)drawerShouldClose:sender set to always return NO.
I tried just returning oldSize, and that doesn't seem to make any
difference, if when the user changes the window width.
Anyhow, I like the result better than my current way of doing it, so
this will go into the next release of iData 3.
--Mike Wright
email@hidden
email@hidden
The problem is that I want the child
window to *act* like a drawer, and in particular it should be
capable of
becoming key (so that a table in the pseudo-drawer can respond to
keypresses) but the main window should not lose its appearance (i.e.
its
title bar should not change). How do I do this?
I have already implemented the advice here:
http://www.cocoabuilder.com/archive/message/cocoa/2005/8/17/144442
This prevents the main window from losing its appearance, but the
table in
the pseudo-drawer is not receiving keypresses. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, http://tinyurl.com/2ouo3b
Take Control of Customizing Leopard, http://tinyurl.com/2t9629
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
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