Re: Custom background in NSTableHeaderView

2009-11-17 Thread Kiran Kumar S


Hi,

	CellAttributes are used by button and button cell for displaying  
image and text accordingly, but tableHeaderCell doesn't uses these  
attributes for displaying image and  text.. Customize the  
NSTableHeaderCell and draw the image and text in drawWithFrame method.




Thanks
SKiranKumar




On 16-Nov-09, at 4:12 PM, Symadept wrote:


Hi,

I am trying to display custom image and the attributed text into the
TableHeaderview. For this I am retrieving the HeaderCell of each  
TableColumn
and setting its image and attributed text. Then I found out If I set  
image

first and then text next, only attributed text shown with the default
headerview background. If the Image is set after Text then  
Background image

overlaps the text.

I am overriding NSTableView and doing two things.

1. setDrawsBackground:NO
2. Invoking empty drawBackgroundInClipRect:clipRect.

Here is my code.

- (void)setColumnHeaderOf:(id)identifier image:(NSImage*)image title:(
NSString*)title

{

NSTableColumn *column=[self tableColumnWithIdentifier:identifier];

[[column headerCell] setCellAttribute:NSCellHasImageOnLeftOrBottom to:
NSImageBelow];

[[column headerCell] setImage:image];

NSMutableAttributedString *attributedString =  
[[NSMutableAttributedString

alloc] initWithString:title];

NSMutableParagraphStyle * aParagraphStyle = [[[NSMutableParagraphStyle
alloc] init] autorelease];

[aParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];

[aParagraphStyle setAlignment:NSCenterTextAlignment];

CGFloat dividingFactor = 255.0f;

NSMutableDictionary * aTitleAttributes = [[[NSMutableDictionary alloc]
initWithObjectsAndKeys:

  [NSFont fontWithName:CP_FONT_NAME size:[NSFont systemFontSize]],
NSFontAttributeName,

  aParagraphStyle, NSParagraphStyleAttributeName,

  nil] autorelease];

[aTitleAttributes setValue:[NSColor colorWithDeviceRed:(246/ 
dividingFactor)
green:(204/dividingFactor) blue:(37/dividingFactor) alpha:1.0f]  
forKey:

NSForegroundColorAttributeName];

[attributedString addAttributes:aTitleAttributes range:NSMakeRange(0,
[attributedString length])];

[[column headerCell] setAttributedStringValue:attributedString];

[attributedString release];

}


- (void)awakeFromNib

{

NSLog(@"KBCustomTableView awakeFromNib");

[[self enclosingScrollView] setDrawsBackground:NO];

NSRect frameRect = [[self headerView] frame];

[[self headerView] setFrameSize:NSMakeSize(frameRect.size.width, 30)];

[self setColumnHeaderOf:@"Column1" image:[NSImage  
imageNamed:@"ColHdr1"]

title:@"Column1"];

[self setColumnHeaderOf:@"Column2" image:[NSImage  
imageNamed:@"ColHdr2"]

title:@"Column2"];

[self setColumnHeaderOf:@"Column3" image:[NSImage  
imageNamed:@"ColHdr3"]

title:@"Column3"];


}



- (void)drawBackgroundInClipRect:(NSRect)clipRect

{

NSLog(@"KBCustomTableView drawBackgroundInClipRect");

//[super drawBackgroundInClipRect:clipRect];

}


Thanks in advance.

Regards
symadept
___

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/kirankumar.s%40prithvisolutions.com

This email sent to kirankuma...@prithvisolutions.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: Help needed in Writing network usage monitor application

2009-11-17 Thread Nick Zitzmann

On Nov 17, 2009, at 9:39 PM, Aashishk Tiwari wrote:

> What APIs/library/Technology we should use that notifies us about network
> usages and also provides us with the data being transmitted.

You can get the raw transfer statistics using IOKit, but you need Pcap to spy 
on the interface(s).

> I have look in libpcap that pretty much gives the packets but i dont know
> how much it helps in notification kind of things.

It doesn't. You'll have to parse the packets manually. Good luck.

Nick Zitzmann




___

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: Vector images on Cocoa

2009-11-17 Thread Gideon King
WebKit has experimental SVG support 
(http://webkit.org/projects/svg/index.html), but I haven't tried it. 

I have been successfully using PDF vector images, which are pretty much the 
recommended standard format. 

We have also used EPS images, but found that occasionally people have crasher 
bugs with them, and we have not found any workaround. It happens for something 
like 1 person per 5,000 of our users, so it's pretty rare, but we have never 
been able to solve the issue, except by disabling the loading of EPS images for 
those people.

HTH.

Gideon


> I would need some way of loading vectorized images from files and drawing 
> them to my custom NSView derived class, scaled up or down according to the 
> frame of the control. I was thinking of using SVG files but there seems not 
> to be any easy way of handling them in Cocoa and I feel that implementing my 
> own SVG parser would be of too much work. What would you recommend? EPS?

___

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: Vector images on Cocoa

2009-11-17 Thread Jens Alfke
PDF is the standard vector format. NSImage supports loading and  
drawing it.


--Jens   {via iPhone}


On Nov 17, 2009, at 1:47 AM, Henri Häkkinen   
wrote:



Hello.

I would need some way of loading vectorized images from files and  
drawing them to my custom NSView derived class, scaled up or down  
according to the frame of the control. I was thinking of using SVG  
files but there seems not to be any easy way of handling them in  
Cocoa and I feel that implementing my own SVG parser would be of too  
much work. What would you recommend? EPS?


Thank you.

Regards,
Henri Häkkinen

___

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/jens%40mooseyard.com

This email sent to j...@mooseyard.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


Help needed in Writing network usage monitor application

2009-11-17 Thread Aashishk Tiwari


Hi All,

We are developing a network usage monitor cocoa application that should be
able to log what urls user is visiting, what streaming media being played,
what url is open in which browsers etc.
We need to get notified when any new url is visited or etc.

What APIs/library/Technology we should use that notifies us about network
usages and also provides us with the data being transmitted.

I have look in libpcap that pretty much gives the packets but i dont know
how much it helps in notification kind of things.

is there a Mac counter part of something like TDI (Transport Data
inferface) available in Win Vista?

Please guide me on this.

Thanks,
Aashish


Aashish Tiwari

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. 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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


problem to connect network

2009-11-17 Thread 郭一波
I have an app in data card using the apple sample code "MoreSCF" and "DIAL" 
to create a link and connect to network. 
 
Now, I meet some problems, 
 
1. I used the "MoreSCF" to create a dialup set which configuared with "dial 
number", "user name", "password"; 
   but the customer said that there was no "user name", "password" sent to 
the network; 
what's wrong with it?
 
2. The PAP/CHAP, I didn't know what can be done with it, where I can 
configure it with code?
 
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


firstResponder KVO snow leopard crash; bug?

2009-11-17 Thread Aaron Clarke
We have an application that runs fine on leopard (10.5) but occasionally
crashes on snow leopard (10.6) when closing an NSWindow.  Here is the
backtrace for the crash:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x
0x976e691b in objc_msgSend ()
(gdb) bt
#0  0x976e691b in objc_msgSend ()
#1  0x197142d0 in ?? ()
#2  0x9031e88e in NSKeyValuePushPendingNotificationPerThread ()
#3  0x9031e224 in NSKeyValueWillChange ()
#4  0x9030350b in -[NSObject(NSKeyValueObserverNotification)
willChangeValueForKey:] ()
#5  0x90327cfe in _NSSetObjectValueAndNotify ()
#6  0x92745fb8 in -[NSWindow makeFirstResponder:] ()
...

Even if it doesn't crash, closing the NSWindow always results in the
following error message.

An instance 0x11b75230 of class MyWindow was deallocated while key value
observers were still registered with it. Observation info was leaked, and
may even become mistakenly attached to some other object. Set a breakpoint
on NSKVODeallocateBreak to stop here in the debugger. Here's the current
observation info:
 (
 Context: 0x0,
Property: 0x4453e60>
 Context: 0x0,
Property: 0x4453e60>
)

I looked at what the observer object's class is, and it's a subclass of
NSCollectionView.  We do not explicitly setup a KVO relationship for
firstResponder.  I also noticed that the "Application Kit Release Notes for
Snow Leopard" mention that firstResponder is KVO-compliant, which makes me
believe this is something new in Snow Leopard.  All this information makes
me believe this is potentially a bug in Application Kit for 10.6.  Maybe we
setup an NSCollectionView incorrectly or I'm misinterpreting this
information?

-Aaron
___

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


Vector images on Cocoa

2009-11-17 Thread Henri Häkkinen
Hello.

I would need some way of loading vectorized images from files and drawing them 
to my custom NSView derived class, scaled up or down according to the frame of 
the control. I was thinking of using SVG files but there seems not to be any 
easy way of handling them in Cocoa and I feel that implementing my own SVG 
parser would be of too much work. What would you recommend? EPS?

Thank you.

Regards,
Henri Häkkinen

___

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 stop NSScrollView from scrolling to top when horizontally resizing contained NSTextView?

2009-11-17 Thread Ross Carter
> Fundamentally, I want to:
> 
> 1. Display lines of text that don't wrap in my NSTextView.
> 2. Display a horizontal scrollbar.
> 3. Make sure that the width of the NSTextView is appropriately wide
> for that line of text so that:
> 3.1 The user can scroll the width of the longest line of text and no more.
> 3.2 The scrollbar thumb is representative of that width.
> 
> The samples I found online to enable horizontal scrolling set the
> width of NSTextContainer and NSTextView to the FLT_MAX, which is not
> what I want to do as that invalidates my 3rd requirement (above).

Sorry, I meant to reply to the list instead of directly to you. I think you 
will find that you still want the text container width to be something like 
FLT_MAX. You don't need to make the text container the same width as the 
longest line of text. 


> Perhaps I'm misunderstanding, but this seems to be exactly how Xcode's
> text editor window works.

You mean when wrapping is turned off? You get that behavior for free. Try this:

1. Create a new project in XCode.
2. In the app delegate header, set up an IBOutlet to a NSTextView.
3. In interface Builder, add a NSTextView to the window and connect it to the 
IBOutlet.
4. Add this to the app delegate .m :

- (void)awakeFromNib {
[myTextView setHorizontallyResizable:YES];
NSSize tcSize = [[myTextView textContainer] containerSize];
tcSize.width = FLT_MAX;
[[myTextView textContainer] setContainerSize:tcSize];
[[myTextView textContainer] setWidthTracksTextView:NO];
}

Run the app. As you add text to the text view, you will see that the horizontal 
scroller adjusts as needed to accommodate the longest line. You don't have to 
do anything more.

From the docs: "Whether it tracks the size of its NSTextView or not, an 
NSTextContainer doesn’t grow or shrink as text is added or deleted; instead, 
the NSLayoutManager resizes the NSTextView based on the portion of the 
NSTextContainer actually filled with text." 
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/TextStorageLayer/Tasks/TrackingSize.html#//apple_ref/doc/uid/2927

-Ross___

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


Core Data derived property not recognized after save & reopen

2009-11-17 Thread David Catmull
I have an entity with a "date" property, and derived properties "year" and 
"month" (by having year/month methods in my NSManagedObject subclass). In a 
couple of different places, I fetch the entries from a particular year or 
month- the fetch requests's predicate says "year == 2009". 

This works fine except in a document that has been saved and reopened: the 
first time I make a change to an object, and then try to fetch a list of 
objects by year, an exception is thrown saying "keypath year not found". What 
confuses me is that between reopening the document, and making a change, I can 
make (as far as I can tell) the same request to filter by year (or month) 
without problems. It doesn't matter which property I change - date or anything 
else.

So I have two questions:
1. Why would this happen?
2. What's a good, simple way to write a unit test that simulates closing an 
reopening a Core Data document? I want to avoid actual file operations for the 
sake of simplicity, but NSPersistentDocument does not implement the 
dataOfType:error: method.

-- 
David Catmull
uncom...@uncommonplace.com
http://www.uncommonplace.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: API for Open Directory domain?

2009-11-17 Thread Glen Low

On 18/11/2009, at 6:34 AM, Kyle Sluder wrote:

On Tue, Nov 17, 2009 at 2:21 PM, Glen Low   
wrote:

I know you can retrieve the user name via NSUserName(). Is there an
equivalent API for the user's Open Directory/Kerberos etc. domain?  
I'm after
the equivalent of the Windows domain, where a USER in a DOMAIN  
comes out

like DOMAIN\USER.


Aside from not being Cocoa related, this question is kind of
meaningless.  The World Is Not Windows.  Users don't have "domains" in
Open Directory.  An individual user can also hold Kerberos tickets
from different realms.

--Kyle Sluder


Sorry about the non-quite-Cocoa post. Newbie to OD here.

I wonder if we can continue this off-list.

I do know that OD has some notion of "directory domain", are not users  
part of a directory domain? If so, how I do find out the directory  
domain of the currently logged on user?


(Scratch the question about Kerberos.)




Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
aim: pixglen
twitter: pixelglow

___

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 make single-row IKImageBrowserView?

2009-11-17 Thread Ashley Clark
On Nov 10, 2009, at 4:55 PM, John Fox wrote:

> Hello Nice Cocoa People:
> 
> I'd like to be able to create an IKImageBrowserView that only displays a 
> single row of items that scrolls horizontally as needed. I didn't find any 
> public API for doing this, even though (from what I understand at least) 
> IKImageBrowserView uses NSCollectionView which has the 
> setMaxiumumNumberOfRows: method. Is there some public way of accessing an 
> IKImageBrowserViews's underlying NSCollectionView instance? Otherwise, is 
> there some trick I'm missing? Someone suggested that I could programmatically 
> set the size of by image browser view based on the cell size and the number 
> of items, which I imagine would work, but I'm wondering if there's an easier 
> way.
> 
> Any help greatly appreciated.


Set the height of your browser view to whatever you'd like that will contain a 
single row of your image cells. Then in your controller's -awakeFromNib use 
[imageBrowser setContentResizingMask:NSViewWidthSizable] to tell it you only 
want it to expand horizontally. Apparently the default is NSViewHeightSizable 
and I see no way to override that via IB.

The normal autosizing springs/struts in IB don't seem to affect the 
contentResizingMask at all for an IKImageBrowserView.


Ashley



___

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: [iPhone] customizing UIView animation run background color

2009-11-17 Thread Tharindu Madushanka
ah Thanks :) self.view.window.backgroundColor worked but I did not try
superview thing. Thank you

-Tharindu
___

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: [iPhone] customizing UIView animation run background color

2009-11-17 Thread Tharindu Madushanka
This is the method I use to switch views. And my views are created with
Interface Builder

- (IBAction)switchViews {
   self.view.backgroundColor = [UIColor blackColor];
   [UIView beginAnimations:nil context:nil];
   [UIView setAnimationDuration:1.25];
   [UIView setAnimationCurve:
   UIAnimationCurveEaseInOut];

   [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self.view cache:YES];
   [self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:2];
   [UIView commitAnimations];
}

I cannot guess why its white bacground when animation runs :( Could any one
guess why is it ?

Thank you.
-Tharindu
___

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 stop NSScrollView from scrolling to top when horizontally resizing contained NSTextView?

2009-11-17 Thread Lyndsey Ferguson
On Tue, Nov 17, 2009 at 11:28 AM, Ross Carter  wrote:
> On Nov 16, 2009, at 4:33 PM, Lyndsey Ferguson wrote:
> I'm not sure exactly what you are trying to do, but it looks to me like you 
> might be on the wrong track. Again, forgive me if I have misunderstood, which 
> I often do, but I see these problems:

Hi Ross,

Fundamentally, I want to:

1. Display lines of text that don't wrap in my NSTextView.
2. Display a horizontal scrollbar.
3. Make sure that the width of the NSTextView is appropriately wide
for that line of text so that:
 3.1 The user can scroll the width of the longest line of text and no more.
 3.2 The scrollbar thumb is representative of that width.

The samples I found online to enable horizontal scrolling set the
width of NSTextContainer and NSTextView to the FLT_MAX, which is not
what I want to do as that invalidates my 3rd requirement (above).

http://lists.apple.com/archives/cocoa-dev/2002/Feb/msg01845.html


> You are using two different systems to determine width. After the text view's 
> layout manager has already completed layout, you are calling the NSString 
> method -sizeWithAttributes:, which uses a different layout system to layout 
> and measure the text. The information you need can be gleaned from the text 
> view's layout manager, perhaps with 
> -lineFragmentUsedRectForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:. 
> In effect, you are laying out the text twice, using different systems that 
> might well produce different results.

I did try using lineFragmentX calls to try and get the width of the
line of text (but failed as the lines of text were wrapped), but I had
not used the call that you mentioned. I will try it out.

>there are other differences that can crop up too, such as whether the 2 layout 
>systems use the same typesetter compatibility setting.

Okay.

> Finally, this behavior does not sound like something that I, as a user, would 
> want. I'm accustomed to exactly two kinds of layout: text with an infinite 
> width, i.e. no line wrapping, and text with a fixed width, i.e. line wrapping 
> that occurs at a certain width. I don't think I could get used to a layout 
> system where the width varies as I type.

Perhaps I'm misunderstanding, but this seems to be exactly how Xcode's
text editor window works.

Thanks for you suggestions, I'll let the list know how it works for me.

Cheers,
Lyndsey
___

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: API for Open Directory domain?

2009-11-17 Thread Kyle Sluder
On Tue, Nov 17, 2009 at 2:21 PM, Glen Low  wrote:
> I know you can retrieve the user name via NSUserName(). Is there an
> equivalent API for the user's Open Directory/Kerberos etc. domain? I'm after
> the equivalent of the Windows domain, where a USER in a DOMAIN comes out
> like DOMAIN\USER.

Aside from not being Cocoa related, this question is kind of
meaningless.  The World Is Not Windows.  Users don't have "domains" in
Open Directory.  An individual user can also hold Kerberos tickets
from different realms.

--Kyle Sluder
___

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


API for Open Directory domain?

2009-11-17 Thread Glen Low

Hi All

I know you can retrieve the user name via NSUserName(). Is there an  
equivalent API for the user's Open Directory/Kerberos etc. domain? I'm  
after the equivalent of the Windows domain, where a USER in a DOMAIN  
comes out like DOMAIN\USER.





Cheers, Glen Low


---
pixelglow software | simply brilliant stuff
www.pixelglow.com
aim: pixglen
twitter: pixelglow

___

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 are the interface builder components?

2009-11-17 Thread Ricky Sharp

On Nov 16, 2009, at 9:28 PM, Sandro Noël wrote:

> I guess i'll have to make my own.
> I just find it sad to have to duplicate work, it's unproductive.


True, but keep in mind the amount of effort that Apple would need to do if they 
provided the custom control, etc:

* Must work with localized content
* Must work with accessibility
* For particular controls, probably need to have multiple sizes (large, small, 
mini)
* Probably will need to expose custom bindings
* Should work in resolution independence.
* Probably some other things I'm missing.

Definitely file an enhancement request though.  I'm sure Apple will strongly 
look into providing something if several developers end up asking for the same 
type of controls.

___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.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: message to zombie NSWindowController

2009-11-17 Thread James Walker

James Walker wrote:
When running on Tiger, my NSWindowController subclass that runs a modal 
preferences dialog gets a retain message after it has been deallocated. 
 I can't reproduce this on Snow Leopard.  The backtrace starts:


#0  0x92cc5fb8 in -[_NSZombie retain] ()
#1  0x92c2f1cc in -[NSInvocation retainArguments] ()
#2  0x93c5bc70 in _NSSendCommitEditingSelector ()
#3  0x93c7f1ec in -[NSController 
_controllerEditor:didCommit:contextInfo:] ()

#4  0x90a461f4 in objc_msgSendv ()
#5  0x92bf3fcc in -[NSInvocation invoke] ()
#6  0x92bf457c in -[NSInvocation invokeWithTarget:] ()
#7  0x92c02f38 in __NSFireDelayedPerform ()
#8  0x907f2384 in __CFRunLoopDoTimer ()

Items #2 and #3 make me think this might have something to do with the 
NSEditor protocol, but I don't understand how.  As far as I can tell, I 
don't have any objects that conform to that protocol... no NSDocument, 
no NSObjectController, etc.


OK, I was wrong about this, I do use NSUserDefaultsController, which is 
a subclass of NSController.  Apparently, when my OK button handler calls 
[mUserDefController save: self], that calls -[NSObject 
performSelector:withObject:afterDelay:inModes:], resulting in the zombie 
call.  I still don't understand why the user defaults controller would 
want to retain the window controller.

--
  James W. Walker, Innoventive Software LLC
  
___

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: [Q] Expanded tooltips in Cocoa?

2009-11-17 Thread Eric Gorr

On Nov 17, 2009, at 2:20 PM, Sean McBride wrote:

> On 11/17/09 1:57 PM, Eric Gorr said:
> 
>> In carbon, you could define both default and expanded tooltips for views.
>> 
>> I found this old thread:
>> 
>>   http://lists.apple.com/archives/cocoa-dev/2003/Aug/msg00591.html
>> 
>> which indicated that expanded tooltips were not supported in Cocoa.
>> 
>> In my hunting through the guides, I believe this is still the case. Or,
>> have I missed something?
> 
> It's still the case.  10.6 added many API for things that previously
> needed Carbon, but not this thing. :(  Perhaps it has fallen out of
> favour with the HI folks.  Does the HIG still discuss them?
> 
> (PS: my bug is 5965794, if you want to reference it in your dupe.)

Thanks. 

Duplicate filed: rdar://7401294

Hopefully they will provide support for it again soon or, perhaps, some better 
alternative.

___

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: [Q] Expanded tooltips in Cocoa?

2009-11-17 Thread Sean McBride
On 11/17/09 1:57 PM, Eric Gorr said:

>In carbon, you could define both default and expanded tooltips for views.
>
>I found this old thread:
>
>http://lists.apple.com/archives/cocoa-dev/2003/Aug/msg00591.html
>
>which indicated that expanded tooltips were not supported in Cocoa.
>
>In my hunting through the guides, I believe this is still the case. Or,
>have I missed something?

It's still the case.  10.6 added many API for things that previously
needed Carbon, but not this thing. :(  Perhaps it has fallen out of
favour with the HI folks.  Does the HIG still discuss them?

(PS: my bug is 5965794, if you want to reference it in your dupe.)

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


[Q] Expanded tooltips in Cocoa?

2009-11-17 Thread Eric Gorr
In carbon, you could define both default and expanded tooltips for views.

I found this old thread:

http://lists.apple.com/archives/cocoa-dev/2003/Aug/msg00591.html

which indicated that expanded tooltips were not supported in Cocoa. 

In my hunting through the guides, I believe this is still the case. Or, have I 
missed something?

p.s. if you have gone to the extra effort of supporting expanded tooltips in 
Cocoa, how did you do it?___

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 replace ComboBoxCell with TextFieldCell when not editing

2009-11-17 Thread Corbin Dunn
On Nov 16, 2009, at 9:25 PM, Symadept wrote:
Hi,
> 
> I want to replace the ComboBoxCell with TextFieldCell when I am not editing
> the cell and shall be replaced with ComboBoxCell when clicked on that
> particular cell. Any pointers highly appreciable.

Use:

- (NSCell *)tableView:(NSTableView *)tableView 
dataCellForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row 

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


addObserver:forKeyPath:options:context: memory management in GC

2009-11-17 Thread Sean McBride
Hi all,

The docs for addObserver:forKeyPath:options:context: say "Neither the
receiver, nor anObserver, are retained.".  They don't comment on the
garbage collected case specifically.  Does any know for sure?

Does calling this method add a strong reference between the receiver and
'anObserver'?  (I'm assuming not.)

Thanks,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

2009-11-17 Thread Nick Zitzmann

On Nov 17, 2009, at 7:51 AM, Tom Davie wrote:

> I'm trying desperately to find where the API for scanning images is, I've
> found the Image Capture API on developer.apple.com, but I can't find a more
> recent version than one for 10.4, and none of the sample code compiles any
> more, worse the sample apps crash on launch.
> 
> What should I be searching the docs for here?

For 10.6 and later, you ought to use IKScannerDeviceView, which apparently has 
no documentation at the time except for a few small mentions on ADC, such as  
,
 and the comments in the header file. It really isn't that difficult to figure 
out on your own, actually.

For 10.5 and earlier, use ICAImportImage(). Don't call this method in Snow 
Leopard! Not only does it not work, but it ends up crashing at some point if 
you don't have GC turned on. Yes, I filed a bug.

Nick Zitzmann


___

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

2009-11-17 Thread Gordon Apple
Here's the current status.  I seem to have everything working, partly
due to you guys.  Thanks.  However, now having analyzed this thing to death,
I'm filing a bug report.

First a summary of the (extended) problem.  The view is layer hosted.
Its layer has a sublayer called "content", which has sublayers, one of which
is A, which is to be transitioned to B.  This is akin to a
PowerPoint/Keynote slide transition.  Layers A and B also have sublayers,
A1, A2, etc., which transition in al la "build" in PP.

According to the docs, using [content addAnimation:trans
forKey:kCATransition] should have worked for slide transitions.  It didn't.
However, using the delegate method, augmented by an ivar enable flag, did
work.

Next, tried the delegate method for builds.  Didn't work.  It
transitioned in the entire layer stack (all sublayers of A or B) instead of
the single inserted layer. So I went back to using [B addAnimation:trans
forKey:kCAOnOrderIn] for builds.  That worked properly.

None of this makes any sense, other than the build-transitions being one
level deeper in the hierarchy than the side transitions.


Definition of "software development":  A series of experiments,
hopefully culminating in the desired result.


On 11/16/09 2:02 PM, "cocoa-dev-requ...@lists.apple.com"
 wrote:

> 
> On Mon, Nov 16, 2009 at 11:01 AM, Matt Neuburg  wrote:
>> Nothing here "runs contrary to the documentation." We're now talking apples
>> and oranges. The "key" used in addAnimation:forKey: (such as kCATransition)
>> has nothing whatever to do with the "key" that arrives in
>> actionForLayer:forKey:. They both happen to be called "key" but that's all.
>> The former, as I explained in my previous message, is just an arbitrary
>> name, which is used just in case you need to call removeAnimationForKey:
>> later, and for no other purpose. The latter is the name of a CALayer
>> animatable property; that property is changing, and you are now being asked
>> whether to animate that property.
> 
> You have it backwards.  kCATransition is documented to be sent as the
> action identifier to -actionForLayer:forKey: whenever the sublayer
> tree changes.  Instead, CA is only sending @"sublayers".  This is
> incorrect.



___

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: Creation date of Feb 14th 1946 - Why?

2009-11-17 Thread Sean McBride
On 11/16/09 5:16 PM, Matt Gough said:

>Can someone let me know if there is something magical about a file
>having its creation date set to:
>
>1946-02-14 08:34:56 +
>
>I am guessing it is a special flag used by Finder to let it know that a
>file is busy (since even after a restart a file with such a creation
>date is shown dimmed)
>Am I correct?
>
>Are there any other magic dates that are being used?
>
>FYI - I am writing a FUSE file system and need to prevent such dates
>ending up at the back-end.

Perhaps you're seeing kMagicBusyCreationDate?  See Finder.h comments.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

2009-11-17 Thread Jean-Daniel Dupas
http://developer.apple.com/mac/library/samplecode/ScannerBrowser/

Le 17 nov. 2009 à 15:51, Tom Davie a écrit :

> I'm trying desperately to find where the API for scanning images is, I've
> found the Image Capture API on developer.apple.com, but I can't find a more
> recent version than one for 10.4, and none of the sample code compiles any
> more, worse the sample apps crash on launch.
> 
> What should I be searching the docs for here?
> 
> Thanks
> 
> Bob
> ___
> 
> 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/devlists%40shadowlab.org
> 
> This email sent to devli...@shadowlab.org
> 

-- Jean-Daniel




___

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: [iPhone] customizing UIView animation run background color

2009-11-17 Thread Tharindu Madushanka
before animation I have set the background color but it did not work. Still
it was white even I set it to black. it seems like color is not coming from
self.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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [iPhone] customizing UIView animation run background color

2009-11-17 Thread Luke the Hiesterman

self.view.backgroundColor = [UIColor blueColor]; //cause why not blue?

Luke

On Nov 17, 2009, at 7:32 AM, Tharindu Madushanka wrote:


Hi

I am using following method to flip between UIViews that have  
imageviews on
it as background. When I animate the views. I could see white  
background
color at animating time. Can I change this color. What I currently  
do is

like this.

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIAnimationCurveEaseInOut];

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self.view cache:YES];
[self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:2];
[UIView commitAnimations];

while at animation time white background color is there. Could I  
change this

?

Thank you

-Tharindu
___

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/luketheh%40apple.com

This email sent to luket...@apple.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


[iPhone] customizing UIView animation run background color

2009-11-17 Thread Tharindu Madushanka
Hi

I am using following method to flip between UIViews that have imageviews on
it as background. When I animate the views. I could see white background
color at animating time. Can I change this color. What I currently do is
like this.

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIAnimationCurveEaseInOut];

[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
forView:self.view cache:YES];
[self.view exchangeSubviewAtIndex:1 withSubviewAtIndex:2];
[UIView commitAnimations];

while at animation time white background color is there. Could I change this
?

Thank you

-Tharindu
___

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


Scanning

2009-11-17 Thread Tom Davie
I'm trying desperately to find where the API for scanning images is, I've
found the Image Capture API on developer.apple.com, but I can't find a more
recent version than one for 10.4, and none of the sample code compiles any
more, worse the sample apps crash on launch.

What should I be searching the docs for here?

Thanks

Bob
___

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: Creation date of Feb 14th 1946 - Why?

2009-11-17 Thread Matt Gough
Try duplicating a large file in Finder and do Get Info while it is copying.

Matt


On 16 Nov 2009, at 18:20:57, Knut Lorenzen wrote:

> 
> Am 16.11.2009 um 18:16 schrieb Matt Gough:
> 
>> Can someone let me know if there is something magical about a file having 
>> its creation date set to:
>> 
>> 1946-02-14 08:34:56 +
> 
> Matt,
> 
> I am unable to reproduce this on 10.6.2 by setting the creation date of a 
> testfile using
> 
> SetFile -d "02/14/1946 08:34:56" testfile.txt
> 
> in Terminal. Are you sure this is the reason for the dimming in Finder? The 
> ENIAC thing explains it very nicely, though.
> 
> Greetings from Hamburg, Germany
> 
> Knut
> 
> ___
> Dipl.-Phys. Knut Lorenzen
> 
> 
> 
> 
> 

___

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 can a plug-in bundle get access to its own resources?

2009-11-17 Thread Alastair Houghton
On 17 Nov 2009, at 08:59, Motti Shneor wrote:

> First, to clear things, I'm not WRITING plug-ins. I'm transitioning our 
> EXISTING product line from Carbon to Cocoa, to be able to run within 64bit 
> Host applications (which, do not exist yet.). Within this scope, I 
> contemplate the way to re-package our deployed "plug-in" entities and other 
> frameworks with Obj-C wrappers.

I understand that.  So does everyone else.  We also understand that your code 
base is large and that you don't want to change every existing class name or 
redesign your build system on every platform.  But nothing anyone has said so 
far requires that you do any of those things.  If you think you do, it's 
because you are labouring under some misunderstanding about Cocoa/ObjC.

All we're saying is that *for your ObjC classes*, you need the names to be 
unique across your entire process, and in practice that means prepending them 
with something.  For a plug-in system, especially if it plugs in to code in a 
third-party process, I strongly recommend that you use something akin to Java's 
reverse domain scheme, even though, as I say, that isn't the usual solution for 
Objective-C code.

I don't see why that would require the kind of changes you're indicating it 
would.

> I must be sure that when a plug refers to the base framework, It'll use the 
> exact version it linked agains, and was tested to work with.

Right.  Yes, it will.  The framework versioning mechanism is just a variation 
on the usual symlink system used on most UNIX-like systems for shared 
libraries.  The only difference is that the structure is not flat (so whereas 
you might see e.g. "libcrypto.dylib" symlinked to "libcrypto.0.9.8.dylib", here 
it's the folders that are symlinked).

>> On 16/11/2009, at 18:58, Alastair Houghton wrote:
>> 
>> Moreover, Cocoa provides such API (mainBundle) for applications, which makes 
>> perfect sense to everyone. How is it that ONLY application bundles support 
>> this API? After all, every code bundle is structured the same, and includes 
>> resources etc.
>> 
>> It *isn't* only application bundles that support it.  It works just fine 
>> with *any* bundle.  But the -bundleForClass: method assumes (as does the 
>> rest of the ObjC runtime) that each ObjC class has a unique name.
> 
> I double-checked it, and you're wrong.

Ah, sorry, I see what you meant---you were talking specifically about the 
-mainBundle method itself.  I had misunderstood your sentence (I think perhaps 
a language issue---a native English speaker would probably have used "this" 
rather than "such", which has a somewhat different meaning here).

> When my plug-in bundle is loaded by the host application, and some of my code 
> is being called if it uses the [NSBundle mainBundle]; API it will get the 
> application bundle, not its own bundle. There is no generic API for any 
> running code to ask "what is MY bundle". Only applications can do that.

As you've been told already, you need -bundleForClass:.  The problem you are 
having with it is because you're misusing the Objective-C language and runtime, 
and you're doing that---you claim---because for some reason your Objective-C 
class names can't possibly be prepended with a unique identifier for each 
plug-in.  Quite frankly, I don't buy it; it shouldn't require changes to the 
build system on all your other platforms to achieve that, and it isn't 
complicated.

Kind regards,

Alastair.

--
http://alastairs-place.net



___

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