Re: Changing a custom field editor's position
The PhotoSearch[1] sample code from Apple uses a custom cell and overrides -selectWithFrame:inView:editor:delegate:start:length: and - editWithFrame:inView:editor:delegate:event: to resize the field editor within a larger cell. Ashley [1] http://developer.apple.com/SampleCode/PhotoSearch/index.html On Apr 30, 2009, at 12:01 AM, K. Darcy Otto wrote: Hi Ulai, Did you find a solution to this problem? I'm trying to do the same thing. Darcy Hi, Let's say I want to have the field editor for a table view appear 2 pixel below where it usually is, i.e. shifted 2 pixels down. How can I do this? Consider the following hypothetical situation: If I subclass NSTextView and override the drawRect method like this, - (void)drawRect:(NSRect)rect { NSRect frame = [self frame]; frame.origin.x += 5.0; [self setFrame:frame]; [super drawRect:rect]; } and use this subclass for the field editor of my table view, no changes occur. But shouldn't this custom field editor move by 5.0 pixels to the right on and on until it finally disappears and becomes invisible? But for some reasons that does not happen. This means that setting the frame's origin apparently has no effect. And that is essentially why I'm all blank on how to reposition the field editor. Any ideas? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Changing a custom field editor's position
Hi Ulai, Did you find a solution to this problem? I'm trying to do the same thing. Darcy Hi, Let's say I want to have the field editor for a table view appear 2 pixel below where it usually is, i.e. shifted 2 pixels down. How can I do this? Consider the following hypothetical situation: If I subclass NSTextView and override the drawRect method like this, - (void)drawRect:(NSRect)rect { NSRect frame = [self frame]; frame.origin.x += 5.0; [self setFrame:frame]; [super drawRect:rect]; } and use this subclass for the field editor of my table view, no changes occur. But shouldn't this custom field editor move by 5.0 pixels to the right on and on until it finally disappears and becomes invisible? But for some reasons that does not happen. This means that setting the frame's origin apparently has no effect. And that is essentially why I'm all blank on how to reposition the field editor. Any ideas? Thanks, U ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Changing a custom field editor's position
On Mar 15, 2009, at 9:45 AM, Ulai Beekam wrote: Hi, Let's say I want to have the field editor for a table view appear 2 pixel below where it usually is, i.e. shifted 2 pixels down. How can I do this? Consider the following hypothetical situation: If I subclass NSTextView and override the drawRect method like this, - (void)drawRect:(NSRect)rect { NSRect frame = [self frame]; frame.origin.x += 5.0; [self setFrame:frame]; [super drawRect:rect]; } Moving stuff in drawRect is bad, for various reasons. You can move it in -viewWillDraw. Also, if that doesn't work the way you want, try repositioning the fieldeditor after calling super from -editColumn:... --corbin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Changing a custom field editor's position
Hi, Let's say I want to have the field editor for a table view appear 2 pixel below where it usually is, i.e. shifted 2 pixels down. How can I do this? Consider the following hypothetical situation: If I subclass NSTextView and override the drawRect method like this, - (void)drawRect:(NSRect)rect { NSRect frame = [self frame]; frame.origin.x += 5.0; [self setFrame:frame]; [super drawRect:rect]; } and use this subclass for the field editor of my table view, no changes occur. But shouldn't this custom field editor move by 5.0 pixels to the right on and on until it finally disappears and becomes invisible? But for some reasons that does not happen. This means that setting the frame's origin apparently has no effect. And that is essentially why I'm all blank on how to reposition the field editor. Any ideas? Thanks, U _ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com