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

On 2009-09-28, at 7:01 AM, JECKER Frédéric wrote:

It seems that my last post hooked up somewhere (sorry for the  
repost) :

Hi,
Is it possible to control the background color of NSTokenField  
tokens ?

Googling this topic didn't returned me any interesting results.
Could anyone give me some urls covering this topic / give me some  
trails to

follow (subclass NSTokenField cell ?)

Thanks a lo
___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 before post this question but I'm stucked.

I'm trying to subclassing NSScroller to change the aqua look and,  
most important, to change the width of the vertical scroll bar.


My subclass is:

- (void)drawRect:(NSRect)rect
{
  [self drawKnobSlot];
  [self drawKnob];
}

- (void)drawKnob
{
  NSRect rect = [self rectForPart:NSScrollerKnob];
  [[NSColor darkGrayColor] set];
  [NSBezierPath fillRect:rect];
}

- (void)drawKnobSlot
{
  NSRect rect = [self rectForPart:NSScrollerKnobSlot];
  [[NSColor grayColor] set];
  [NSBezierPath strokeRect:rect];
}

It works and change the look as I want but not the width. I tried to  
set rect width but is not the right way because the rect goes beyond  
the scrollview.


Any help is appreciated.

Thanks,
Max

___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 lockFocus];

[tint set];
NSRectFillUsingOperation(imageBounds, NSCompositeSourceAtop);

[copiedImage unlockFocus];

return [copiedImage autorelease];
}

Brandon

On 2009-08-29, at 2:36 PM, Mitchell Livingston wrote:


Hello,

I want to use NSImage's built-in template images, but want to  
replace the black color with different colors, such as gray or  
orange. I feel like I'm missing something obvious, but I can't seem  
to figure this out. Could someone point me in the right direction.


Thanks,
Mitch
___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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  
resized, both panes of the split view resize proportionally. I would  
like one pane to remain fixed while the other resizes. Xcode does  
this, as well as iCal and other apps.


Is there a delegate method that does this or must I subclass  
NSSplitView?


Thanks,
Soong




___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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 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 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 NSSliderCell's knob thickness

2009-08-16 Thread Brandon Walkin
I'm trying to make a vertical slider with a knob that's 1 pt tall. I  
can't quite figure out how to do this without rewriting NSSliderCell.


Overriding -knobThickness and returning a particular thickness doesn't  
seem to have any effect on the thickness of the knob. The - 
setKnobThickness: method is deprecated, but it too seems to have no  
effect on the knob size.


I could fake it by drawing a 1 pt tall line in the center of the large  
knob rect I'm provided and drawing the slider track with an inset on  
both sides so the 1 pt tall knob can reach both ends of the slider.  
The issue with that is when the area on the track near the knob is  
clicked, the knob won't move to that position. And when that area on  
the track is dragged, the knob moves as though it's being dragged.  
Since NSSliderCell thinks the knob is thicker, it thinks the click is  
on the knob instead of the track.


I've made a basic sample app that you can play with: 
http://www.box.net/shared/ylqm2uck5o

Any help would be appreciated. Thanks.

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 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: 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  [UIColor blueColor] then  
it works, but it doesn't work with RGB doing [[UIColor alloc]  
initWithRed .. ]
I tried also [UIColor colorWithCGColor:CGColorCreateGenericRBG 
()]; but the compiler just decided to send error that  the  
method CGColorCreateGenericRGB its unreachable, even I have the  
CoreGraphics library in the project and im importing in in the  
file... dunno what to do.. I need to be very accurate with the color  
that im setting, I know the values in rgb but  why is not working?



Thnaks
Gustavo Pizano



On Jul 29, 2009, at 11:29 AM, Gustavo Pizano wrote:


Hello.

Im trying to change the color of a UIView programatically but  
something is wrong.



Im pressing a button which triggers an IBAction, which does the  
following:


[[self view] setBackgroundColor:[UIColor colorWithRed:20.0 green: 
10.0 blue: 30.0 alpha:1.0]];


but when I press the button the program blows with an  
NSInvalidArgumentException..


what am I doing wrong?


thanks

Gustavo Pizano





___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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  
"blablabla". I've found that it would be most suitable to use  
rounded textrured button and change its title, image and image  
position in the onClick: handler. Everything is OK, but I can't find  
how to set an image from template, which we can see in the IB. We  
can choose several images there, in particular, I've chosen  
NSCoLeftTemplate and NSCoRightTemplate for button states. But how to  
change them in runtime? As far as I can understand, I should write  
something like this:


[myButton setImage:[NSImage .]]

but the question is what messages to use here and how to reach those  
templates, as we can see in the IB?


I tried imageNamed, but it does not find an image. I tried to search  
in Google for NSCoLeftTemplate / NSCoRightTemplate, but they're not  
found.


Thanks.


___

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


[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  
Leopard support and various fixes and improvements.


For those who haven't heard of BWToolkit, it's a BSD licensed plugin  
for Interface Builder that contains commonly used UI elements and  
other objects designed to simplify Mac development.


Learn more and download here: http://brandonwalkin.com/bwtoolkit/

-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 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: 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: http://brandonwalkin.com/bwtoolkit/


-Brandon


On 1-May-09, at 6:42 PM, Alex Kac wrote:

I know there was a discussion about this a few months ago on this  
list, but I cannot find the right terms to search for. The  
discussion was how to draw text so that it was sunken much like you  
see in the toolbar. I just remember there was a specific way  
recommended to do it and I can't find it. Drawing the text twice is  
more of a shadow effect, so I don't think that was it...


Alex Kac - President and Founder
Web Information Solutions, Inc.

"Patience is the companion of wisdom."
--Anonymous




___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 wrote:

1.  How do I change that blue cube (which displays when the  
textfield is selected) to my graphic (like NSNumberFormatter and  
NSDateFormatter)?


___

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: NSTextField and clickable links

2009-03-31 Thread Brandon Walkin

http://developer.apple.com/qa/qa2006/qa1487.html

It has to be selectable and allow editing text attributes.

On 31-Mar-09, at 9:15 AM, Vijay Kanse wrote:


Hello List,

I have successfully set Url to text field with attributed strings. I  
am not

able to get hand cursor on textfield.
I am using this code for clickable link.
   [thetextfield setAllowsEditingTextAttributes:YES];
   NSMutableAttributedString *attrstr = [[NSMutableAttributedString  
alloc]

initWithString:[thetextfield stringValue]];
   NSRange selectedRange = { 0, [[thetextfield stringValue] length] };

   [attrstr beginEditing];

   NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
   [dictionary setValue:[NSNumber  
numberWithInt:NSSingleUnderlineStyle]

forKey:NSUnderlineStyleAttributeName];
   [dictionary setValue:theurl forKey:NSLinkAttributeName];
   [dictionary setValue:[NSColor colorWithCalibratedRed:0.1 green: 0.1
blue:1.0 alpha:1.0] forKey:NSForegroundColorAttributeName];
   [dictionary setValue:[NSCursor pointingHandCursor]
forKey:NSCursorAttributeName];

   [attrstr addAttributes:dictionary range:selectedRange];

   [attrstr endEditing];

   [thetextfield setAttributedStringValue:attrstr];

I am getting all things o.k.
but i am not able to see hand icon on application start on textfield.
I tried to add a cursor on text field.

[thetextfield addCursorRect:[thetextfield bounds] cursor:[NSCursor
pointingHandCursor]];

i write this methods in awakeFromNib.

can any one tell me what is the problem with displaying Pointing  
Hand Cursor

?
am i missing to set any property for text field.

text field displays hand cursor once i clicked on it and it changes  
its

fonts also.


any help will be appreciated.


Thanks.
___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 images ? I'd like to have a look at some
examples of how this is achieved as I've had no luck so far, going it
alone.

What I'm looking to achieve is the look & feel of the new iTunes
scroller, but without the buttons, much like on the search results in
the popular app Coversutra.

Thanks

-Mic
___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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


[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 as "collapsible", and hook a button up to an action on the  
split view which will collapse or expand the collapsible subview with  
Core Animation.


Watch a screencast of the split view in action and read more about it  
here: http://www.brandonwalkin.com/blog/2009/02/24/bwtoolkit-11-codeless-split-views/


If you've never heard of BWToolkit, this webpage outlines all the  
features: http://brandonwalkin.com/bwtoolkit


Cheers,
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 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: 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 a look at any toolbar text in Leopard. It has a subtle,  
white shadow. How can I get this very same effect in my own app when  
using NSString's drawInRect method? What attributes to use? Do you  
have any sample code?


Thanks, U.



_
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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, the user won't notice the temporary lack of subpixel rendering.


If the view sits on a constant background, then you can retain  
subpixel antialiasing while the view is layer backed, provided that it  
draws a background. Some views (like text fields, for instance) can be  
configured to draw a background color in Interface Builder. Other  
views (like the check box you have in your sample project) need to be  
subclassed to draw a background. Just override -drawRect:, draw your  
background, and call super.  Keep in mind, the background you draw  
doesn't need to be a flat color. It can be a gradient or some wacky  
pattern, as long as it's opaque.


-Brandon

On 7-Feb-09, at 10:36 PM, m wrote:

Is it the case that I can have a layer backed view (and thus nice  
animations), or I can have labels and checkboxes whose text is  
nicely subpixel anti-aliased, but not both?


I feel like I'm missing something but when I put a check box in a  
layer backed view, it looks terrible. It's poorly antialiased and  
there is no subpixel rendering.


Demo at 

_murat

___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 NSCollectionView to some place else) and I found this old  
thread:


http://lists.apple.com/archives/cocoa-dev/2008/Oct/msg00104.html

Unfortunately, no clear solution was mentioned and I was wondering  
if someone might be able to point me to one.


Thank you.

___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 setMovableByWindowBackground:TRUE]. This makes window  
movable from
every point I drag my mouse pointer. Now if I place an NSImage  
Object over
the window and try to drag the whole window there by only dragging  
the Image

, it does not works.

Is there is any way to drag the whole window just by dragging the  
Image

placed on it?



Thanks in advance!



Regards,

Rahul



___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 point in drawRect:.


Here's the relevant code from BWToolkit (http://brandonwalkin.com/bwtoolkit 
):


static NSColor *topColor, *middleTopColor, *middleBottomColor,  
*bottomColor;

static NSGradient *gradient;

+ (void)initialize;
{
topColor = [[NSColor colorWithCalibratedWhite:(253.0f / 255.0f)  
alpha:1] retain];
middleTopColor = [[NSColor colorWithCalibratedWhite:(242.0f /  
255.0f) alpha:1] retain];
middleBottomColor = [[NSColor colorWithCalibratedWhite:(230.0f /  
255.0f) alpha:1] retain];
bottomColor	= [[NSColor colorWithCalibratedWhite:(230.0f /  
255.0f) alpha:1] retain];


gradient = [[NSGradient alloc] initWithColorsAndLocations:
   topColor, (CGFloat)0.0,
   middleTopColor, (CGFloat)0.45454,
   middleBottomColor, (CGFloat)0.45454,
   bottomColor, (CGFloat)1.0,
   nil];
}

- (void)drawRect:(NSRect)rect
{   
rect = self.bounds;

NSRect gradientRect =  
NSMakeRect 
(rect.origin.x,rect.origin.y,rect.size.width,rect.size.height - 1);

[gradient drawInRect:gradientRect angle:270];
}

On 22-Jan-09, at 7:57 AM, Sam Krishna wrote:


I think my understanding of NSGradient's use may be off here

I'm trying to create a custom NSView that uses NSGradient to shade  
the view in such a way that it mimics Apple's two-tints NSView. You  
can see the color scheme at the bottom left hand corner of Mail and  
the NSView at the bottom of Automator (I'm sure there are other  
apps, but I can't figure out which ones they are).


Here's the code I'm using for -drawRect:

- (void)drawRect:(NSRect)rect {
   // Drawing code here.
   NSArray *_colorArray = [NSArray arrayWithObjects:
   [NSColor colorWithDeviceRed:0.9843 green: 
0.9843 blue:0.9843 alpha:1.0],
   [NSColor colorWithDeviceRed:0.9608 green: 
0.9608 blue:0.9608 alpha:1.0],
   [NSColor colorWithDeviceRed:0.8824 green: 
0.8824 blue:0.8824 alpha:1.0],

   nil];

   NSGradient *_gradient = [[NSGradient alloc]  
initWithColors:_colorArray];

   [_gradient drawInRect:rect angle:90];
   [_gradient release];
}

Am I using the right NSGradient method? Is it the right angle?

I tried using -drawFromPoint:toPoint:options:, but that didn't work,  
either. Any ideas?


Live Playfully,

Sam
-
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: @loader_path and @executable_path

2009-01-12 Thread Brandon Walkin

On 12-Jan-09, at 5:00 PM, Dave Dribin wrote:


On Jan 12, 2009, at 10:47 AM, Joseph Crawford wrote:
I do not know if this is a cocoa question or not, it is an error I  
get when I hit build & go


This GDB was configured as "i386-apple-darwin".tty /dev/ttys001
warning: Unable to read symbols for "@loader_path/../Frameworks/ 
BWToolkitFramework.framework/Versions/A/BWToolkitFramework" (file  
not found).
warning: Unable to read symbols from "BWToolkitFramework" (not yet  
mapped into memory).
warning: Unable to read symbols for "@loader_path/../Frameworks/ 
Sparkle.framework/Versions/A/Sparkle" (file not found).
warning: Unable to read symbols from "Sparkle" (not yet mapped into  
memory).


These are just debugger errors.  This is most like due to those  
frameworks being compiled in Release mode with their debug symbols  
stripped.  It should not affect debugging of your own application.


I did some googling and found that people used a tool to use  
@executable_path rather than @loader_path but I also read that  
those values should be the exact same so changing them is not the  
optimal change to make.


For an application, they resolve to the same thing.

Does anyone have any idea where I can see / set these values?  I  
have checked my Xcode Project Build settings, the framework build  
settings, etc. and cannot find them.


They are set in the frameworks project, not yours.  So if you're  
linking to pre-built versions of Sparkle and BWToolkit, there are no  
settings in your app that affect this.


In general, @loader_path is preferred over @executable_path, as it  
allows embedded frameworks to work in both an executable and a  
bundle, plugin, or sub-framework.  The only downside is that  
@loader_path requires 10.4 or newer.  If you're on 10.5 or newer,  
@rpath is even better than @loader_path.


-Dave




I'm the developer of BWToolkit. Some users have run into this problem  
where the framework would work fine for them for a while, and then one  
day it would output the warnings that Joseph mentioned. My Xcode/gcc  
knowledge is a bit lacking, so I haven't been able to figure this one  
out. Do you know what changes have to be made in the BWToolkit Xcode  
project to fix this issue?


Thanks,
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 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: Implementing an Inspector similar to the one in IB.

2009-01-11 Thread Brandon Walkin

Here's a BSD licensed implementation by Jonathan Dann: 
http://espresso-served-here.com/2008/10/24/i-love-outline-views-heres-mine/

On 11-Jan-09, at 3:20 AM, Brian Bruinewoud wrote:


Hi,

I'm an experienced C++ developer but a relative newbie to Objective- 
C and Cocoa and am learning my way.


I would like to implement an inspector that has views that show/hide  
by clicking on their headings similar to the ones in the Interface  
Builder inspector.


This control doesn't seem to be available in the IB library, though.  
Am I overlooking it? (I checked the splitview and tab view controls  
as I thought that these might do what I want).


If I have to implement it myself, are the any tutorials or  
suggestions as to how to go about it?


Thanks,
Brian
___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 be 2 pixels thick, but one pixel would be the  
divider and the other would be the subview's border.


To change the color, you can use BWSplitView (which it appears you  
already have loaded in IB). It's a subclass of NSSplitView which, at  
the moment, only adds one feature which is being able to set the color  
for thin dividers in the IB inspector.


The two common divider colors are 64,64,64 and 165,165,165. Please  
don't use black. :)


Brandon

On 6-Jan-09, at 11:05 PM, Graham Cox wrote:

My main document uses a split view with a main content area and a  
source-style list. I'm using the "thin" style of split view along  
with the excellent BWToolbarButton to achieve a standard Apple-ish  
look.


However, the split view ends up with a 2-pixel split bar, whereas  
all other apps I've seen with this layout have a 1-pixel bar. There  
is variation as to its colour in various apps also - some are black  
and some are grey. How can I set this to 1-pixel and/or set the  
colour? - do I need to subclass?



--Graham


___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 example as a guide.  My  control appears (draws  
itself) in the library pane.  When I drag the control to a window in  
IB, only  a rectangle (made up of dots) appears.  The inspector sees  
the control in the window, displays its settings, etc.  I can drag  
the rect around the window and the control coordinates change in the  
inspector as expected.  If I change settings and save the nib file,  
the changes are saved and appear when I next open the nib...but only  
the rectangle appears.  I am not getting any errors, exceptions, etc  
in the debugger.  I would append code if I knew where the issue was  
located.  I am suspecting the the controls view is not inserted  
properly in the view hierarchy?  Has anyone seen this issue.  Any  
suggestions.


Rich
___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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:

How does one make a connected horiz-vert split view like in Xcode,  
you know,  one control point to size in both directions?


HNY cocoa heads!




David Blanton




___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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:


On Dec 31, 2008, at 13:49, Richard Ashwell wrote:

1) I am/was creating my document  class "programatically" like:   
(Note Typed in email, and in my project MyDocument is actually  
named something else)


MyDocument *newDoc = [[MyDocument alloc] init];
[newDoc importData:data];


Not so good. When creating or opening a document, there's more to do  
than just creating the NSDocument instance.  
openUntitledDocumentAndDisplay:error: is the way to go.


By itself this wouldn't pop up a document because of the overridden  
applicationShouldOpenUntitledFile: method


No, that had nothing to do with it. By creating the NSDocument  
instance directly, you simply weren't getting the document window  
shown.



So I added:

[newDoc makeWindowControllers];  and the method mentioned below.

Reading your notes carefully though it looks like I maybe should be  
using openUntitledDocumentAndDisplay:error instead of the  
makeWindowController thing that got my document to popup perhaps  
only because I added the showWindow:self to the end of that method.


Exactly.

And you are probably right that I am getting two instantiations,  
but only "seeing" one.


I will test your suggestion first, though It might take me a few  
because the template doesn't generate a NSDocumentController, only  
the NSPersistentDocument class itself so I first have to figure out  
how to add the Controller to my AppController class and stuff  
without breaking everything,  I should be able to  get  
openUntitledDocumentAndDisplay:error to work (I bet it does, so  
here is a pre thank you!!!),


No need to stress! NSDocumentController is a singleton object that  
every AppKit application gets for free. So instead of:


  MyDocument *newDoc = [[MyDocument alloc] init];

just write this:

  NSError *error;
  MyDocument *newDoc = [[NSDocumentController  
sharedDocumentController] openUntitledDocumentAndDisplay: YES error:  
&error];

  if (!newDoc)
  ... // report the problem described in 'error'

... I pulled out the extra call to makeWindowControllers and  
traced, When the document gets create via the New menu item the  
makeWindowControllers gets called automatically like you described,  
but just instantiating the document with MyDocument *newDoc =  
[[MyDocument alloc] init]; doesn't call makeWindowControllers.   
Perhaps that is what the NSDocumentController is supposed to do for  
me?


Yup. It also causes the document to appear on the Window menu for  
you, and populates the Open Recent menu.



___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: 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 at
runtime, but it's a uuid, can't I set a custom identifier?


You can't set one in IB. The workaround is to declare outlets in  
your File's Owner object to each of the toolbar items you need to  
refer to, and then use the outlets directly (or get the IB-assigned  
identifier via the outlet, if that's what you need). That will  
probably feel a bit hokey, but perhaps a future version of IB will  
have a more elegant implementation for this.




Replying a bit late here but I should point out that since version  
1.0.2 of the BWToolkit IB plugin, it has supported the ability to  
specify an toolbar item's identifier in the inspector.


Screenshot: http://www.quicksnapper.com/bwalkin/image/item-identifier
Info & Download: 
http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/
___

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: 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 of a computer.
I want to create a button with this same (or similar) image.

I can use [ sharedWorkspace iconForFile: fullPath ] to get an  
image of a home folder, or of a disk partition.


But I cannot find a computer image. Also looked at "Icon Services  
and Utilities Reference" but did not find anything there.


When I need to do this kind of thing, I use  spotlight to show me  
all the images in /System/Library/ in icon view.


Well, I looked at Finders Search For -> All Images (some 18000  
images) but did not see a computer.


If the documentation for [NSImage imageNamed:] would have mentioned  
that image names are to be found in the Constants section, this  
would have helped a lot.
But it only says that it will: "Search the Application Kit framework  
for a shared image with the specified name."
So I looked in the Application Kit framework, but did not find  
anything.


Kind regards,

Gerriet.

___

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/bwalkin%40gmail.com

This email sent to bwal...@gmail.com


___

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: Newbie. Creating SubViews that aren't associated with NSWindow, or NSPanel?

2008-12-10 Thread Brandon Walkin
The NSPanels are unnecessary middle men in your case. Rather than  
using an NSPanel in order to access its contentView, instead create a  
new standalone view object in IB by dragging in a custom view from the  
library to the document window (not the canvas). Then double click the  
view's icon in the document window, and the view will open up in a  
window. You can then go ahead and lay out its contents, just as you  
would with a NSPanel's contentView.


On 10-Dec-08, at 5:30 PM, aaron smith wrote:


Hey Ken and Nick, thanks for the feedback. I have continuing questions
if you wouldn't mind.

"archive them in a nib, load the nib, and then attach them to the
window or window's content view."
-So I would use a separate nib that contains NSPanels, with the views
layed out in that, load the nib, then attach it's content to the main
windows content?

"Why not use a tab view?"
-I did think of this, but wasn't sure if this would be bad practice. I
wouldn't see why it would be bad, but wasn't sure. In any case I think
trying to do it without tabs is a good exercise.

"Views don't need to be contained in a window in the nib. You can drag
a view from the library directly into the nib. You can then set up
outlets from, for example, File's Owner to these views to reference
them later in the code."
-So, by doing this, you don't get to visually see the view in
interface builder? But through code you would piece it all together?
Is there a way to visually see in interface builder the view, 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 it
here: http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/
Cheers,
Brandon
On 10-Dec-08, at 3:50 PM, aaron smith wrote:

Hey All, this could be a newbie question, or a somewhat mid-level
question. Basically, I don't understand how I can create "views" that
aren't associated with an NSWindow, or NSPanel.

Here's a breakdown of what I'm trying to accomplish..
-I have a MainMenu nib.
-in that it has the usual 1 window.
-On the Window, I have a NSToolbar.
-The NSToolbar has 2 buttons (view1,view2) View 1 will be the  
default.


Now what I want to do is show/hide view1/view2 depending on which
button you click. What I'm confused about is achieving "tab" like
behavior, without using a tab view.

How do I go about create views separately, and attaching them to the
NSWindow, based on the toolbar buttons. I'm looking for is some
direction.

Here's kind of what I was thinking..

option 1. Create multiple NSWindows or NSPanels, for view1,view2. Use
the contentView property of those windows to attach to my main window
when you've clicked a toolbar button.
option 2. Use separate nibs for the views, each nib would be an
NSPanel. Then the main bundle loads those nibs in, attaches it's
contentView to the main bundle's main view.

Is this the right direction? I'd really appreciate some feedback.

Thanks all
___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]



___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


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 trying to do  
something like setBackgroundColor, but instead of picking a color, I  
want to pick an image.


The end goal is to program an emulator for a small medical device  
like an insulin pump; so the background of the window would be an  
image of the device, and then I'd put some buttons and fields and  
such on top.

___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


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

2008-12-10 Thread Brandon Walkin

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  
it here: http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/


Cheers,
Brandon

On 10-Dec-08, at 3:50 PM, aaron smith wrote:


Hey All, this could be a newbie question, or a somewhat mid-level
question. Basically, I don't understand how I can create "views" that
aren't associated with an NSWindow, or NSPanel.

Here's a breakdown of what I'm trying to accomplish..
-I have a MainMenu nib.
-in that it has the usual 1 window.
-On the Window, I have a NSToolbar.
-The NSToolbar has 2 buttons (view1,view2) View 1 will be the default.

Now what I want to do is show/hide view1/view2 depending on which
button you click. What I'm confused about is achieving "tab" like
behavior, without using a tab view.

How do I go about create views separately, and attaching them to the
NSWindow, based on the toolbar buttons. I'm looking for is some
direction.

Here's kind of what I was thinking..

option 1. Create multiple NSWindows or NSPanels, for view1,view2. Use
the contentView property of those windows to attach to my main window
when you've clicked a toolbar button.
option 2. Use separate nibs for the views, each nib would be an
NSPanel. Then the main bundle loads those nibs in, attaches it's
contentView to the main bundle's main view.

Is this the right direction? I'd really appreciate some feedback.

Thanks all
___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


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 this in your app, just copy the method into a class of  
yours and set it as the split view's delegate using the -setDelegate:  
method. You can read more about delegation in the docs: http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_4.html


Cheers,
Brandon

On 8-Dec-08, at 4:07 AM, Jushin wrote:


Could you tell me more in detail?
It makes me more confusing :(
Sorry for novice question.

On Mon, Dec 8, 2008 at 3:29 AM, Benjamin Dobson
<[EMAIL PROTECTED]> wrote:


On 8 Dec 2008, at 08:03:51, Jushin wrote:

However, I have no idea how to do this. Should I create a subclass  
of

NSSplitView?


No. Just wire up a different object as the delegate for your split  
view.

___

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/cocorub%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Creating a Bottom Bar on NSWindow

2008-12-02 Thread Brandon Walkin
You can use my BWToolkit plugin for Interface Builder to add a bottom  
bar. The advantage to using the plugin rather than doing it  
programmatically (as Andre suggested) is that you'll be able to see  
the bottom bar in IB which makes it easy to position UI elements on or  
above it.


Here's a link: 
http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/

-Brandon

On 2-Dec-08, at 7:59 PM, Mike Chambers wrote:


I am working on an app, and need to create a "bottom bar" for it.

I could not find any control or info on how to do this, but I noticed
that if I set the Appearance : Texture attribute to true in Interface
Builder (for the window), I seemed to get a bottom bar.

You can see a screenshot here:

http://www.flickr.com/photos/mikechambers/3077911711/

My question is:

Is this the correct way to create the bottom bar?

Is there any way to style the window so it look more like itunes
(itunes has a lighter grey).

Thanks for any input...

mike
___


___

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 [EMAIL PROTECTED]


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:(int)anIndex animate:(BOOL)shouldAnimate

The index is the raw toolbar index - it's zero based and includes  
spaces and separators. And in your case you'd pass in NO for  
animation. In a future version of BWToolkit, I'll likely make this  
more obvious and base it on the item identifier or the item label  
rather than the index.


Cheers,
Brandon


On 15-Nov-08, at 8:51 PM, Dave DeLong wrote:


Hey everyone,

I've been playing around with Brandon's new BWToolKit, and I was  
wondering if there's any way to hook the ToolbarItems up through  
code.  I've got a window with four different sections, and I want  
to have some NSMenuItems that, when selected, will open the window  
to the appropriate section.


The closest I've come is to grab all the item identifiers and  
select them that way, but I was wondering if anyone's found a more  
robust way to do that.


Thanks,

Dave


I've been playing with this too, and I used -setSelectedIndex:  
because that is in your header and -switchToItemAtIndex:animate: is  
marked as private. I also tried using NSToolbar's - 
setSelectedItemIdentifier:, however that causes the toolbar icon to  
change but not the view, so you may want to override that.


1) add:
- (void)setSelectedItemIdentifier:(NSString *)itemIdentifier
{
  selectedIndex = [itemIdentifiers indexOfObject:itemIdentifier];
  [self switchToItemAtIndex:[self  
toolbarIndexFromSelectableIndex:selectedIndex] animate:YES];

}

2) change line 284 in -selectItemAtIndex: to call supers  
implementation:

[super setSelectedItemIdentifier:identifier];

Using the label to change the toolbar selection is not a good idea  
because the labels may be localized and then they won't match. And  
using the index only works for toolbars that can't be modified. You  
could create a custom NSToolbarItem class in IB and add the  
identifier to the IB inspector, that way developers can set custom  
identifiers in IB like they can when creating the toolbar items in  
code.


One more thing, any of the headers (like BWSelectableToolbar.h) that  
users of your framework may need to use your classes, should be  
marked as public so that the headers are exported with the framework  
and then we can include them like:

#import "BWToolkitFramework/BWSelectableToolbar.h"


--Nathan



Thanks for the suggestions. I'll implement them for the next release.

Just a note: I'm tracking issues on Bitbucket so if you have any other  
bugs or feature enhancements, please post them there. http://www.bitbucket.org/bwalkin/bwtoolkit/issues/


Cheers,
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 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]


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 includes  
spaces and separators. And in your case you'd pass in NO for  
animation. In a future version of BWToolkit, I'll likely make this  
more obvious and base it on the item identifier or the item label  
rather than the index.


Cheers,
Brandon


On 15-Nov-08, at 8:51 PM, Dave DeLong wrote:


Hey everyone,

I've been playing around with Brandon's new BWToolKit, and I was  
wondering if there's any way to hook the ToolbarItems up through  
code.  I've got a window with four different sections, and I want to  
have some NSMenuItems that, when selected, will open the window to  
the appropriate section.


The closest I've come is to grab all the item identifiers and select  
them that way, but I was wondering if anyone's found a more robust  
way to do that.


Thanks,

Dave
___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


[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 bars, a textured slider, a gradient token field, and  
much more.


You can read about it in more detail, watch screencasts, and download  
the plugin (along with the source) on my blog:

http://www.brandonwalkin.com/blog/2008/11/13/introducing-bwtoolkit/

Cheers,
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 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]


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 image. Even though I set it up in IB  
(move image to the back, bring the label to the front), the label is  
always drawn behind the image. Is there a setting to be set in IB  
for that or do I have to draw the text myself?


Thanks,

Andre Masse
___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


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 and focus ring, the only  
thing that happens when you start editing the field is that the text  
is highlighted.
When I  edit my NSTextFieldCell (Without border and focus ring) in  
my NSTableView, the background goes black and a white border is  
shown around it, as the following picture shows: http://img143.imageshack.us/img143/5513/bild2su2.png


I hope that clarifies what I'm trying to do. :)

Cheers,

Tim Andersson

___

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 [EMAIL PROTECTED]


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 to 34 for a large bar, or 24 for a small one. Edge  
should be NSMinYEdge.


Cheers,
Brandon

On 7-Aug-08, at 2:20 PM, Sumner Trammell wrote:


Hi, I've notced that in most apps, at the top and bottom, there is a 1
pixel black line separating the gray window
from the (usually) white content.

This looks better than stock, which of course is why everybody and
Apple seems to be doing it. What is the canonical way to do this?  Are
people using horizontal line NSBox objects to create these?  That
seems like a kludge.  They also make for Illegal Geometry complaints
from Interface Builder.


Thanks,
-s
___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


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 and images in a single cell.

My difficult is in getting system media template images to invert  
when the cell is highlighted.

The documentation for NSImage - setTemplate states:

You can mark an image as a “template image” to notify clients who  
care that the image contains only black and clear content.


Yes, I detect that an image is a template, but how do I initiate  
"caring".


My feeble attempts at getting my client to care have firstly been to  
try and invert the NSImageRep of the template, but this fails as the  
image rep is the undocumented NSCoreUIImageRep and not a  
NSBitmapImageRep.


My second attempt was along the following lines:

[cell setHighlighted:YES];
[cell setState:NSOnState];
NSImage *image = [cell preparedImage];

A modified - duller - image is returned, but not an inverted one.
I think that this is more along the right track. But something's  
missing (brains probably).


Any enlightenment would be welcome.

Jonathan



___

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/bwalkin%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


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  
at ??
Basically I just want to embed a snapshot view (either PDF or  
Bitmap) to the saved documents and use that for the quicklook... I  
appreciate any hints on where to start with something as simple as  
possible.


Thanks!



Here's a video tutorial that demonstrates how to write a Quick Look  
plugin:


Part 1: http://www.youtube.com/watch?v=GMNSU-PIoOo
Part 2: http://www.youtube.com/watch?v=3ctx5G3f3rM
___

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 [EMAIL PROTECTED]


Re: Constraining a NSSlider to Certain Values

2008-04-12 Thread Brandon Walkin


I have managed to get my slider working the way I want it to by
overriding mousedown and mousedragged, however there is still one
small detail. I cant see how to make the slider knob show its
'pushed' image while the slider is being dragged. Does anyone know
how to do this?

thanks!

Peter




I'm not sure but maybe -[NSCell setHighlighted:] will help you.
If it does not work, have a look at -[NSCell setState:]

That's probably one of this two properties that control the cell
apparence.



Sadly both of those don't appear to do the job. Oh well.

regards,

Peter


To show the pressed image, implement -startTrackingAt:inView: and
-stopTracking:at:inView:mouseIsUp in your cell. All you need to do
in these methods is set a BOOL and then call super. Then in the
method where you draw your knob, check the BOOL and draw the pressed
or normal image accordingly.
___

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 [EMAIL PROTECTED]