Re: NSTokenField token color/control

2009-09-29 Thread Brandon Walkin
I wrote some code a while back to customize the appearance of a token field. Feel free to use it. It does use some private API, though, so beware. http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTokenFieldCell.m http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTokenAttachmentCell.m Brandon

Re: NSScroller width

2009-08-30 Thread Brandon Walkin
Use +scrollerWidth and +scrollerWidthForControlSize. Here's a custom scroller subclass from BWToolkit which might help you out: http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTransparentScroller.m Brandon On 2009-08-30, at 5:25 AM, Massimiliano Gargani wrote: Hi there, I've googled a lot

Re: Applying color to template images

2009-08-29 Thread Brandon Walkin
I have a category on NSImage that should do what you need: - (NSImage *)tintedImageWithColor:(NSColor *)tint { NSSize size = [self size]; NSRect imageBounds = NSMakeRect(0, 0, size.width, size.height); NSImage *copiedImage = [self copy]; [copiedImage

Re: NSSplitView resizing

2009-08-26 Thread Brandon Walkin
This can be done completely in IB if you use BWToolkit. http://brandonwalkin.com/bwtoolkit/ Demo video: http://brandonwalkin.com/blog/videos/iCalSplitView.mov Brandon On 2009-08-26, at 11:48 AM, Oftenwrong Soong wrote: Hi all, I have a window containing a NSSplitView. When the window is

Re: Changing NSSliderCell's knob thickness [SOLVED]

2009-08-17 Thread Brandon Walkin
Returning the smaller knob rect in -knobRectFlipped: seems to do the trick. Brandon ___ 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

Re: Cahnging bgColor of a UIView not working.

2009-07-29 Thread Brandon Walkin
The arguments to that UIColor method should be in the range of 0 to 1. Divide each RGB value by 255 to get them into that range. On 2009-07-29, at 6:34 AM, Gustavo Pizano wrote: Hello, well I found the reason of the exception. But still they color its not being changed if I put

Re: NSButton setImage in runtime : where is template image?

2009-07-26 Thread Brandon Walkin
There's a typo in your image names. Use NSGoLeftTemplate and NSGoRightTemplate (Go instead of Co). On 2009-07-26, at 6:08 AM, Alexander Bokovikov wrote: Hi, All, I'm trying to create a simple switch button, showing something like Show blablabla / Hide blablabla depending on the state of

[ANN] BWToolkit 1.2 - IB Plugin

2009-06-18 Thread Brandon Walkin
Hi all, I've just released version 1.2 of BWToolkit with three new additions: a gradient box with customizable border and inset lines, a styled text field that lets you apply a gradient and a shadow to text, and a hyperlink button to link text or images to URLs. I've also added Snow

Re: Discussion on how to draw text like that seen in toolbars

2009-05-04 Thread Brandon Walkin
[yourTextFieldCell setBackgroundStyle:NSBackgroundStyleRaised]; This method was introduced in 10.5. If you require Tiger compatibility, you can use NSShadow but you'll be losing subpixel antialiasing. Alternately, you can use BWInsetTextField which is part of the BWToolkit IB plugin:

Re: IB Plugin help

2009-04-05 Thread Brandon Walkin
I haven't yet made an IB plugin with a custom formatter, but I'd assume you change that image the same way you change the image that appears in the document window. Return your own image in the - ibDefaultImage method in your integration category. On 5-Apr-09, at 9:31 AM, jmun...@his.com

Re: Custom NSScroller ...

2009-03-23 Thread Brandon Walkin
Here's some code for a scroller without arrow buttons: http://bitbucket.org/bwalkin/bwtoolkit/src/tip/BWTransparentScroller.m Cheers, Brandon On 23-Mar-09, at 9:14 AM, Mic Pringle wrote: Hi, Can anyone recommend any open source projects that implement a custom NSScroller, perhaps using

[ANN] BWToolkit 1.1 IB Plugin: Codeless Split Views

2009-02-24 Thread Brandon Walkin
Hi all, I've just released a new version of my IB plugin with a split view that requires no programming for common split view functionality. Right within Interface Builder, you can specify which subviews should resize with the split view, set min and max sizes on subviews, mark a subview

Re: How to get the white shadow effect when drawing NSStrings?

2009-02-21 Thread Brandon Walkin
Use a cell to draw your text and call -setBackgroundStyle: on it with the parameter NSBackgroundStyleRaised. That'll apply the exact same shadow that's used on toolbar item labels. Keep in mind that this method is Leopard-only. On 21-Feb-09, at 6:10 AM, Ulai Beekam wrote: Hi, Just take

Re: subpixel rendering vs. layer backed views

2009-02-07 Thread Brandon Walkin
There are a couple tricks you can use to retain subpixel antialiasing. If you're giving the view a layer so you can animate it occasionally, try giving it a layer just before you tell it to animate and removing the layer once the animation is complete. For quick alpha or origin changes,

Re: Drag and drop from NSCollectionView

2009-01-30 Thread Brandon Walkin
I'm also interested in doing this. Have any of you implemented dragging from a collection view in your app, or have any theories on how to go about it? Brandon On 28-Jan-09, at 2:00 PM, Eric Gorr wrote: I am going to need to the same thing (dragging one or more items from a

Re: Drag the whole window just by dragging the Image placed on it?

2009-01-23 Thread Brandon Walkin
Use an NSImageView subclass to draw your image. Put this code in the subclass: - (BOOL)mouseDownCanMoveWindow { return YES; } On 23-Jan-09, at 4:54 AM, Rahulkumar wrote: Hi All, I can move a Window i.e. a NSWindow object with the just a simple call [myWindow

Re: Reverse-engineering Apple's two-tinted gradient NSViews

2009-01-22 Thread Brandon Walkin
The view in question has a 4-stop gradient, with each stop positioned at a particular point, rather than spaced evenly. The view also draws a grey line at the top, so you'll want to reduce the height of the gradient rect by a pixel to leave space for it so you can draw it at some other

Re: Custom NSControl is not visible when dropped on a window from IB3.1 Library

2009-01-06 Thread Brandon Walkin
What you're experiencing could be caused by a number of issues. Mind posting the code? On 4-Jan-09, at 9:41 PM, Richard Humiston wrote: I have a custom NSControl and custom NSCell. I created an IBPlugin and framework per IB Plugin programming guide, and also used the clock control

Re: 2-pixel borders in NSSplitView - I want 1 pixel.

2009-01-06 Thread Brandon Walkin
NSSplitView's thin style produces 1 pt thick dividers. You can verify this by asking the split view for it's -dividerThickness. What's likely happening in your document is that one of your subviews has it's border style set to something other than none in IB. Your divider would appear to

Re: NSPersistent Document but probably a Bindings Noobie Cry for Help

2008-12-31 Thread Brandon Walkin
If you're looking at the same split view as I am (main window), it appears that they're just using a horizontal split view as the right subview in a vertical split view. There doesn't seem to be a resize handle that adjusts both directions. On 31-Dec-08, at 5:27 PM, Quincey Morris wrote:

Re: NSSplitView

2008-12-31 Thread Brandon Walkin
If you're looking at the same split view as I am (main window), it appears that they're just using a horizontal split view as the right subview in a vertical split view. There doesn't seem to be a resize handle that adjusts both directions. On 31-Dec-08, at 5:22 PM, David Blanton wrote:

Re: NSToolbarItem identifier?

2008-12-26 Thread Brandon Walkin
On 22-Dec-08, at 4:37 AM, Quincey Morris wrote: On Dec 22, 2008, at 00:44, aaron smith wrote: I haven't been able to figure out how to set a custom identifier with NSToolbarItem's. Is it possible? I don't see it anywhere in IB, or anywhere in the class documentation? I can see the identifier

Re: Where is the Computer Image ?

2008-12-15 Thread Brandon Walkin
The image is in /System/Library/CoreServices/CoreTypes.bundle/Contents/ Resources On 15-Dec-08, at 12:00 PM, Gerriet M. Denkmann wrote: On 15 Dec 2008, at 19:24, John C. Randolph wrote: On Dec 14, 2008, at 8:53 PM, Gerriet M. Denkmann wrote: Finder.app can show in its Sidebar an image

Re: Setting A Background Image On A Window

2008-12-10 Thread Brandon Walkin
Try making an NSColor from your image using +colorWithPatternImage:, and set that color object on the window using -setBackgroundColor:. On 10-Dec-08, at 4:47 PM, Neil wrote: I've googled around and poked at the documentation in Xcode, but I can't seem to find any references to this. I'm

Re: Newbie. Creating SubViews that aren't associated with NSWindow, or NSPanel?

2008-12-10 Thread Brandon Walkin
, without it being in a window/panel? Thanks a lot for the feedback. On Wed, Dec 10, 2008 at 1:13 PM, Brandon Walkin [EMAIL PROTECTED] wrote: Hi, I've released a free plugin for Interface Builder 3 that contains an easy to use tabbed toolbar that should suit your needs. You can grab

Re: Fixed width of left pane in NSSplitView

2008-12-08 Thread Brandon Walkin
Feel free to use the -splitView:resizeSubviewsWithOldSize: delegate method implementation from this class: http://www.bitbucket.org/bwalkin/bwtoolkit/src/tip/BWAnchoredButtonBar.m It keeps all views except the right most view at a constant width when the window is resized. To incorporate

Re: Playing around with BWToolKit

2008-11-16 Thread Brandon Walkin
Hi Dave, If the user isn't able to configure the toolbar, then all you need to do is get a reference to the BWSelectableToolbar and call this method on it: - (void)switchToItemAtIndex:(int)anIndex animate:(BOOL)shouldAnimate The index is the raw toolbar index - it's zero based and

Re: Playing around with BWToolKit

2008-11-16 Thread Brandon Walkin
On 16-Nov-08, at 5:10 AM, Nathan Kinsinger wrote: On Nov 16, 2008, at 1:50 AM, Brandon Walkin wrote: Hi Dave, If the user isn't able to configure the toolbar, then all you need to do is get a reference to the BWSelectableToolbar and call this method on it: - (void)switchToItemAtIndex

[ANN] BWToolkit - Plugin for IB 3

2008-11-13 Thread Brandon Walkin
Hi all, BWToolkit is a BSD licensed plugin for Interface Builder 3 that contains commonly used UI elements and other useful objects. These include a suite of transparent (HUD) controls, a selectable toolbar for no code preferences windows and tabbed sheets, button bars, textured bottom

Re: Static text over an image

2008-10-29 Thread Brandon Walkin
I've seen it happen a few times where views will be layered in the reverse order that they're set to in IB. Try moving the label behind the image and see if that gives you the desired result. Cheers, Brandon On 30-Oct-08, at 12:48 AM, Andre Masse wrote: Hi, I want to have text over an

Re: Changing NSTextFieldCells' editing appearance?

2008-08-18 Thread Brandon Walkin
The black color you're seeing when editing is the -backgroundColor of the table view. Just override that method and return a more appropriate color. On 18-Aug-08, at 11:00 AM, Tim Andersson wrote: I'm using the NSTextFieldCell in a NSTableView. When using a NSTextField without a border

Re: How do I get those 1 pixel black lines into my app window?

2008-08-07 Thread Brandon Walkin
Use a non-textured window instead of a textured one. You'll get a black line beneath the titlebar (or toolbar). To get a bottom bar with a divider line, call this method on your window: - (void)setContentBorderThickness:(CGFloat)borderThickness forEdge: (NSRectEdge)edge Set the thickness

Re: NSTextFieldCell subclass template image inversion

2008-06-26 Thread Brandon Walkin
You can make a template image white by telling its cell: [cell setBackgroundStyle:NSBackgroundStyleDark] Cheers, Brandon On 26-Jun-08, at 4:18 PM, [EMAIL PROTECTED] wrote: Hello list My NSTextFieldCell subclass is based on ImageAndTextCell.m from the SourceView sample. This displays text

Re: adding Quicklook preview to my app

2008-04-17 Thread Brandon Walkin
On 17-Apr-08, at 4:07 PM, Victor Bovio wrote: Hi, I have a document based Cocoa app (CAD-like), to which I like to add the Leopard quicklook plugin feature. I tried first looking at the Documentation, but looks overwhelming to me, is there a simple tutorial or examples somewhere I can look