Re: Open-source NSToolbar?

2008-04-09 Thread Geoff Beier
On Tue, Apr 8, 2008 at 12:25 PM, John Stiles [EMAIL PROTECTED] wrote:
 Well, I was thinking more along the lines of an RBSplitView, something you
 can just drop into your nib/code and suddenly your toolbars are better :)

Is this what you're looking for? IB3 seems to have it natively, and
this does it for IB2:
http://belkadan.com/generictoolbar/

HTH

Geoff
___

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]


Beginner TableView Questions

2008-04-09 Thread Peter Zegelin
I have an NSTableView with several columns of checkboxes. Each of my  
columns has an identifier. I also have an NSObjectController subclass  
acting as both data source and delegate. I can populate the table with  
some data.


However I am stuck on how to know when a checkbox has been clicked on  
so I can update my model. I would prefer to get the info as a row  
number in a particular column if that is possible.


I actually created an 'update' method in my controller and linked a  
checkbox to this and can receive the message when a checkbox is  
clicked but the sender doesn't have any obvious column/row info so I'm  
pretty sure this isn't the way to go. Also I don't want to use  
bindings as the data is C++;


- (void)update:(id) sender{

}

Any help greatly appreciated,

thanks

Peter

___

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]


NSPersistentDocument not saving after exception

2008-04-09 Thread Theo Vosse

Hi,

My CoreData app (under 10.4) refuses to save the document once an  
exception has been thrown. Its a C++ exception thrown from a menu  
command after displaying an alert and it is caught. It happens both  
on Intel and PPC, in Debug and in Release mode.


What happens after the exception, is that the save operation fails  
without any warning (not even a call to NSLog or [NSException  
raise]). If you choose quit after making changes, the save dialog  
appears. Choosing save then results in the app menu staying  
highlighted, which makes it look as though it is busy, while in  
reality it returns to the main event loop. Choosing the save command  
manually doesn't seem to do anything. When no exception has been  
thrown, saving works normally.


Is this a known bug? Is there a workaround? It's almost impossible  
not to throw the exception (its the error routine deep inside a  
recursive descent parser)...


Thanks,

Theo
___

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: NSTreeController / CoreData still broken in 10.5?

2008-04-09 Thread Jonathan Dann


On 7 Apr 2008, at 23:52, Adam Gerson wrote:


However, I am using CoreData with my TreeController bound to a Managed
Object Context. Can I still supply a contentArray in this situation?

Adam


On Sun, Apr 6, 2008 at 9:36 AM, Jonathan Dann [EMAIL PROTECTED]  
wrote:

Hi Adam,

I've just finished a blog post on this, it's not about using it  
with core

data, but it may help you out.

http://jonathandann.wordpress.com/2008/04/06/using-nstreecontroller/

Hope its useful

Jon

Jonathan P Dann: Trainee Medical Physicist - Homepage - Flickr
contact | [EMAIL PROTECTED] - 07515-352-490 | skype - jonathandann



I'm afraid I'll have to defer to those who know core data better than I.

Sorry

smime.p7s
Description: S/MIME cryptographic signature
___

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]

More NSUndoManager woes

2008-04-09 Thread Graham Cox

The docs for NSUndoManager state for -removeAllActionsWithTarget: that:

An object that shares an NSUndoManager with other clients should  
invoke this message in its implementation of dealloc.


There is a problem with this - if the object being dealloced is itself  
the parameter to an undo invocation, which in anything more  
complicated than a trivial test case it is likely to be, then Cocoa  
goes into an infinite loop when it starts discarding these invocations  
off the bottom of the stack. The undo manager releases the invocation  
which releases the object, which calls - 
removeAllActionsWithTarget:self, and boom - it all falls over.


Can someone tell me if this recommendation is still correct, or what?  
The only way I can stabilize my app is simply not to attempt to do  
this, but I'm not really sure if there are any bad implications for  
NOT calling it.


Is it me, or is NSUndoManager really, really fragile?


--
S.O.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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Text with translucent Background

2008-04-09 Thread fred . redcliffe

Dear All

I am trying to set the background colour of a range of text in  
textview to a color with an alpha value less than 1.


I get the text storage and set its NSBackgroundColorAttributeName   
attribute  (through NSMutableAttributedString calls) to a colour with  
an alpha value less than 1.
However when this background draws it draws the colour as solid and as  
I decrease the alpha value( towards 0.0 )  the colour goes towards  
black.


Any suggestions

Thanks
Fred


___

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: Beginner TableView Questions

2008-04-09 Thread Ron Fleckner


On 09/04/2008, at 5:43 PM, Peter Zegelin wrote:
I have an NSTableView with several columns of checkboxes. Each of  
my columns has an identifier. I also have an NSObjectController  
subclass acting as both data source and delegate. I can populate  
the table with some data.


However I am stuck on how to know when a checkbox has been clicked  
on so I can update my model. I would prefer to get the info as a  
row number in a particular column if that is possible.


I actually created an 'update' method in my controller and linked a  
checkbox to this and can receive the message when a checkbox is  
clicked but the sender doesn't have any obvious column/row info so  
I'm pretty sure this isn't the way to go. Also I don't want to use  
bindings as the data is C++;


- (void)update:(id) sender{

}

Any help greatly appreciated,

thanks

Peter


You could try to get a ref to the table view by asking sender about  
it's superview.  Or you could just get the selected row from the  
tableview itself.  Presumably you have a reference to it.  When the  
button is clicked, the row it's in will be selected.  Not sure, but I  
think you can get the column info from the tableview as well.


HTH,

Ron
___

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]


core data and IB outlet binding

2008-04-09 Thread Torsten Curdt

I have a custom NSCollectionViewItem

@interface FilterViewItem : NSCollectionViewItem {

IBOutlet NSTextField *filterExpression;

}

- (IBAction) applyFilter:(id)sender;

@end

It's getting filled via core data just fine. Then I've also bound the  
filterExpression to the NSTextField in the prototype view. The same  
way the button is bound.


@implementation FilterViewItem

- (IBAction) applyFilter:(id)sender
{
NSString *expression = [filterExpression stringValue];

NSLog(@expression %@, expression);

When the button is pressed it turns out that filterExpression (and  
therefor also the stringValue of it) is nil.


I assume somehow I could probably also get the value from the  
NSArrayController ...but


a) I am not sure how to get hold of the instance from within the  
FilterViewItem


b) I would need to get access to the NSTextField at some stage anyway

What am I missing here?

cheers
--
Torsten

___

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]


How to get a notification which tells a folder name got changed

2008-04-09 Thread norio

Hi,

My app wants to know whether the name or the location of a folder got  
changed.

Is there any notifications to tell those changes?

Thanks in advance.
Norio 
 
___


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 to get a notification which tells a folder name got changed

2008-04-09 Thread Jonathan del Strother
On Wed, Apr 9, 2008 at 11:13 AM, norio [EMAIL PROTECTED] wrote:
 Hi,

  My app wants to know whether the name or the location of a folder got
 changed.
  Is there any notifications to tell those changes?

You might try the FSEvents api
___

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: Text with translucent Background

2008-04-09 Thread Graham Cox
How are you drawing the text? If it's in a NSTextView you also need to  
set the background colour of the view to clear, I believe, and maybe  
you'll need to override the IsOpaque method to return NO.


(I'm not that sure of myself here but I seem to recall something along  
these lines).



--
S.O.S.

On 9 Apr 2008, at 9:31 pm, [EMAIL PROTECTED] wrote:

Dear All

I am trying to set the background colour of a range of text in  
textview to a color with an alpha value less than 1.


I get the text storage and set its NSBackgroundColorAttributeName   
attribute  (through NSMutableAttributedString calls) to a colour  
with an alpha value less than 1.
However when this background draws it draws the colour as solid and  
as I decrease the alpha value( towards 0.0 )  the colour goes  
towards black.


Any suggestions

Thanks
Fred


___

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/graham.cox%40bigpond.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: Beginner TableView Questions

2008-04-09 Thread Graham Cox

If you implement the method:

- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject  
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex


in your datasource it will be called when the checkbox changes state -  
anObject will be the value of the checkbox as an NSNumber and  
aTableColumn's identifier will tell you which column it was part of,  
and the rowIndex tells you the row.

--
S.O.S.


On 9 Apr 2008, at 5:43 pm, Peter Zegelin wrote:
I have an NSTableView with several columns of checkboxes. Each of my  
columns has an identifier. I also have an NSObjectController  
subclass acting as both data source and delegate. I can populate the  
table with some data.


However I am stuck on how to know when a checkbox has been clicked  
on so I can update my model. I would prefer to get the info as a row  
number in a particular column if that is possible.


I actually created an 'update' method in my controller and linked a  
checkbox to this and can receive the message when a checkbox is  
clicked but the sender doesn't have any obvious column/row info so  
I'm pretty sure this isn't the way to go. Also I don't want to use  
bindings as the data is C++;


- (void)update:(id) sender{

}

Any help greatly appreciated,

thanks

Peter

___

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/graham.cox%40bigpond.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]


Layer-Hosting View on NSTabViewItem and switching Pages

2008-04-09 Thread Joachim Deelen

Hi All,

Maybe someone can Help Me?!

I've created a NSTabView with two Pages (NSTabViewItems). On the  
second Page I got a Custom-View, that is hosting a Layer-Tree. This  
tree consist of a CATextLayer, within a CAScrollLayer, within a  
CALayer. The CALayer is the Root-Layer of the View.


When I switch to the second Page, everything works as expected. But  
after switching back to the first Page, the Text within the  
CATextLayer remains displayed for about one second thereby disturbing  
the appearance of the first page.


I've tried to hide the View, before switching the pages. I stop every  
Animation of the Layers immediately before the switch actually  
happens. I even tried to set the opacity of the Layers to 0.0 (and  
called setNeedsDisplay) but to no avail.


Functionality of both Pages is as expected, but the short remains of  
the Text are really annoying.


regards
Joachim Deelen

AQUARIUS-software
http://www.aquarius-software.de



___

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]


componentsToDisplayForPath (running as root)

2008-04-09 Thread spsaxena
Hi all,

I am facing a problem in getting the correct display name while running as
root. Actually while running as root if I call API's like
componentsToDisplayForPath of NSFileManager or LSCopyDisplayNameForRef, they
return me the display path components always in English as the root locale
is English. I wish to get the display name as per the current user.

Can anyone please let me know how can I get the display name of path
components based on logged in user, while running as root. (I tried setting
the euid to that of current user but that did not work).

Thanks,
Sharad!
___

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 to store NSRect as Core Data attribute?

2008-04-09 Thread Adam P Jenkins
Hmm, seems I was misunderstanding what the built-in value transformers  
do, and also had a problem with my custom transformer.  The  
NSUnarchiveFromData transformer won't work for this purpose.  However  
you can make it possible to store NSValue objects as Core Data  
attributes by using a Transformable attribute, and writing your own  
ValueTransformer.   Here's a trivial value transformer that I just  
tried, which allows storing any NSCoding compliant object as an  
attribute value, including NSValues containing an NSRect.   To use it,  
add this class to your project, then create a Core Data attribute of  
type Transformable, and set its Value Transformer Name to  
MyValueTransformer.


// MyValueTransformer.h
#import Cocoa/Cocoa.h


@interface MyValueTransformer : NSValueTransformer {

}

@end

// MyValueTransformer.m
#import MyValueTransformer.h


@implementation MyValueTransformer

+ (Class)transformedValueClass
{
return [NSData class];
}

+ (BOOL)allowsReverseTransformation
{
return YES;
}

- (id)transformedValue:(id)value
{
return [NSArchiver archivedDataWithRootObject:value];
}

// input is expected to be an NSData object
- (id)reverseTransformedValue:(id)data
{
return [NSUnarchiver unarchiveObjectWithData:data];
}

@end


On Apr 9, 2008, at 1:16 AM, Adam P Jenkins wrote:
Actually on Leopard you should be able to store an NSValue as an  
attribute, simply by using an attribute of type Transformable, and  
setting the Value Transformer Name to NSUnarchiveFromData.


I just tried it though, and it seems like there is a bug which  
prevents it from working.  Basically it seems like any custom value  
transformer you set for a Transformable attribute is simply ignored,  
and it still just uses the default transformer, which tries to use a  
KeyedArchiver and KeyedUnarchiver.  I even tried creating my own  
NSValueTransformer subclass and setting it as the value transformer  
for a Transformable attribute.  I can see that its init method gets  
called, but none of its other methods ever get called when saving a  
document.  I just filed a bug with Apple about this, radar 5851442.



On Apr 3, 2008, at 5:31 AM, Daniel Thorpe wrote:


Thanks for the feedback on this.

I have gone with using a ...AsString attribute and using  
NSRectFromString. Seems to work okay, although I've got no idea if  
it's the most efficient method. I think Core Data seems a little  
limited in that you can't store an NSValue object as an attribute,  
I'd have thought that would be obvious, as we use that class to  
store structs in collection objects


I hadn't considered localisation issues, but on my machine it  
stores the data like so in an XML store:


  attribute name=extentasstring type=string{{368, 260},  
{2, 5}}/attribute
  attribute name=centreofmassasstring type=string{368.75,  
263.25}/attribute


which seems to make sense.

Cheers
Dan

On 2 Apr 2008, at 18:33, Uli Kusterer wrote:


On 02.04.2008, at 18:58, Thomas Engelmeier wrote:
That potentially means opening Pandoras can to localisation  
issues. Any time you go that route, be sure to check that code  
with switching decimal separators.



Potentially? Maybe. But I just tried it, and for me  
NSStringFromRect() never uses localized separators. So, since it  
always gives and takes periods as the decimal separator, I see no  
problem. Do you have a particular test case where it behaves  
differently?


Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.zathras.de





___

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/danthorpe%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/adam 
%40thejenkins.org


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: Core Animation layer-backed NSViews and mouse handling

2008-04-09 Thread Bill Dudney

Hi Matt,

I hope what Scott said made sense (and what I said in the book, thanks  
BTW to Mike for the plug).


If you have a layer backed view (i.e. you only call  
myButton.wantsLayer = YES) then you should not ever touch the layer,  
only use the methods that are exposed through the view and its animator.


So if you are going to move a button, just move the button, don't  
touch the layer. My guess is that when you move the layer it moves but  
the view does not and that is why you are seeing the representation of  
the button move but you are not actually able to click it.


Hopefully that answers the why, now on to the how to fix it...

A couple of things;

- if you only want to animate the moving or rotating of the button  
call the animator

- if you don't need to rotate then you don't even need layer backing

In other words move the button like this;

[[myButton animator] setFrameOrigin:newLocation];

this line of code will cause the button (the whole thing,  
representation and view) to move to newLocation. You don't need layers  
in the picture for this to work.


If you want to rotate the button and have things work properly you  
need something like this.


myButton.superview.wantsLayer = YES; // this will cause superview and  
all subviews to be layer backed

[[myButton animator] setFrameCenterRotation:myAngle];

HTH,


-bd-
http://bill.dudney.net/roller/objc

On Apr 8, 2008, at 10:55 AM, Matt Long wrote:


Hey Mani,

I never solved the problem completely, however, I realized that what  
you need to do, or so it seems, is to somehow get notified when the  
animation has finished and then actually move the button to the  
position where the animation stopped. It seems really convoluted to  
me, but I can't find any further documentation as to why when you  
move the button you see it change, but clicking the button at its  
new location no longer works. You have to click in the original spot.


Maybe someone else can shed some light on the why.

-Matt


On Apr 8, 2008, at 6:30 AM, Manfred Schwind wrote:


Hi,

I have a layer-backed NSView, say an NSButton (or a complete view  
hierarchy with many controls), and I am transforming - moving,  
rotating, etc. - its layer around. Now when I try to click the  
NSButton at its currently visible position, drawn by the CALayer,  
it does not work. I have to click into the area where the NSButton  
originally was, before transforming its layer.


Is there an easy way to get this working as expected? Without re- 
implementing the whole mouse handling of all affected views by  
myself?


I know that the mouse handling works when rotating a button with  
setFrameRotation, so Cocoa may internally be prepared for this kind  
situation. Would be really great if this would also work for  
general transformations done by CALayers.


Regards,
Mani
--
http://www.mani.de
iVolume - Loudness adjustment for iTunes.
LittleSecrets - The encrypted notepad.


___

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/matt.long%40matthew-long.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/bdudney%40mac.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]


How to force NSTableView to stop editing a text cell?

2008-04-09 Thread Graham Cox
How can I force a text cell in NSTableView to stop editing? On 10.4 I  
could just tell the view's window to make the entire table the first  
responder and that did the trick, but on 10.5 this no longer works.


I'm trying to do this from within the textDidEndEditing: notification  
method so that I can suppress the table behaviour that goes to the  
next row and starts editing there - I just want the text to end  
editing on typing return and the table view to go back to its previous  
state - same row selected but no text being edited.



--
S.O.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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Beginner TableView Questions

2008-04-09 Thread Peter Zegelin

Thanks Graham - exactly what I needed.


kind regards,

Peter


On 09/04/2008, at 10:07 PM, Graham Cox wrote:


If you implement the method:

- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject  
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex


in your datasource it will be called when the checkbox changes state  
- anObject will be the value of the checkbox as an NSNumber and  
aTableColumn's identifier will tell you which column it was part  
of, and the rowIndex tells you the row.

--
S.O.S.


On 9 Apr 2008, at 5:43 pm, Peter Zegelin wrote:
I have an NSTableView with several columns of checkboxes. Each of  
my columns has an identifier. I also have an NSObjectController  
subclass acting as both data source and delegate. I can populate  
the table with some data.


However I am stuck on how to know when a checkbox has been clicked  
on so I can update my model. I would prefer to get the info as a  
row number in a particular column if that is possible.


I actually created an 'update' method in my controller and linked a  
checkbox to this and can receive the message when a checkbox is  
clicked but the sender doesn't have any obvious column/row info so  
I'm pretty sure this isn't the way to go. Also I don't want to use  
bindings as the data is C++;


- (void)update:(id) sender{

}

___

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: More NSUndoManager woes

2008-04-09 Thread Alastair Houghton

On 9 Apr 2008, at 12:23, Graham Cox wrote:

The docs for NSUndoManager state for -removeAllActionsWithTarget:  
that:


An object that shares an NSUndoManager with other clients should  
invoke this message in its implementation of dealloc.


There is a problem with this - if the object being dealloced is  
itself the parameter to an undo invocation, which in anything more  
complicated than a trivial test case it is likely to be, then Cocoa  
goes into an infinite loop when it starts discarding these  
invocations off the bottom of the stack. The undo manager releases  
the invocation which releases the object, which calls - 
removeAllActionsWithTarget:self, and boom - it all falls over.


I'm not sure I see why you're getting into an infinite loop here.  - 
dealloc should be being called at most once, right?


And it shouldn't be possible to get into a situation where your object  
is the parameter of an undo operation if you're already in that  
object's -dealloc routine.  If that's what you're seeing, you have a  
reference counting bug I think.


Perhaps I'm misunderstanding the problem though?

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


Re: More NSUndoManager woes

2008-04-09 Thread Graham Cox

Hi Alastair,

I'm not sure I fully understand it either - undo issues often make my  
head spin...


I *think* what's happening is that NSUndoManager is unhappy that - 
removeAllActionsWithTarget: is being called while it is in the process  
of discarding an invocation off its own stack. Indeed dealloc is only  
getting called once but the NSUndoManager is being re-entered and  
that's what it seems to be griping about. If there are no actions with  
that target I guess you might get away with it, but it's quite likely  
that there are (and targets are weak refs so they can still be there  
even when the object is being dealloced), so maybe NSUndoManager is  
trying to remove items from its stack while it is already iterating  
over it discarding the invocations that are dropping out.


It's perhaps analogous to the situation of removing objects from an  
array while iterating over it (but then again, who knows, the internal  
workings of NSUndoManager are off-limits).


However you might be right about the ref counting bug, so I'll try and  
re-examine it from that angle.



G.



On 9 Apr 2008, at 11:09 pm, Alastair Houghton wrote:

On 9 Apr 2008, at 12:23, Graham Cox wrote:

The docs for NSUndoManager state for -removeAllActionsWithTarget:  
that:


An object that shares an NSUndoManager with other clients should  
invoke this message in its implementation of dealloc.


There is a problem with this - if the object being dealloced is  
itself the parameter to an undo invocation, which in anything more  
complicated than a trivial test case it is likely to be, then Cocoa  
goes into an infinite loop when it starts discarding these  
invocations off the bottom of the stack. The undo manager releases  
the invocation which releases the object, which calls - 
removeAllActionsWithTarget:self, and boom - it all falls over.


I'm not sure I see why you're getting into an infinite loop here.  - 
dealloc should be being called at most once, right?


And it shouldn't be possible to get into a situation where your  
object is the parameter of an undo operation if you're already in  
that object's -dealloc routine.  If that's what you're seeing, you  
have a reference counting bug I think.


Perhaps I'm misunderstanding the problem though?

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


Re: want to keep a main window still, not close

2008-04-09 Thread Robert Napier
If you really mean main window in the NSWindow sense (makeMainWindow),  
then you will want to look at the windowShouldClose delegate method  
(as mentioned by Jack) and observe the  
NSWindowDidResignMainNotification notification for the window so you  
can set it back.


More likely, though, you should be looking at NSPanel for your other  
windows. If they're stealing mainWindow status, NSPanel will fix that  
because it will refuse to become main. If NSPanel does not meet you  
need, you can make your own subclass of NSWindow or NSPanel to get  
what you're looking for.


-Rob

--
Rob Napier -- Software and Security Consulting -- http://robnapier.net



On Apr 8, 2008, at 5:31 PM, norio wrote:

Hi,
My app is not a document-based application. And it has a main window  
and other windows.


What I want to ask you to tell me is how to remain still the main  
window even if user

option-clicks the close box of one of the other windows.

I tried observing with its name nil and object nil. But I couldn't  
get which notification

actually makes the windows close.

Would you tell me how to remain the main window? Of course, it must  
close if user clicks

the close box of the window.

Any suggestions would be appreciated.

Norio


___

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 to force NSTableView to stop editing a text cell?

2008-04-09 Thread Graham Cox
I found a simple solution - just call -abortEditing before asking the  
window to make the table 1stR. I sometimes forget to look in the  
superclass for a solution, in this case NSControl has one. Seem OK?




- (void)textDidEndEditing:(NSNotification*) aNotification
{
	// this overrides the standard behaviour so that ending text editing  
does not select a new cell for editing
	// Instead the delegate is called as normal but then the table is  
made 1stR.


NSString* theString = [[aNotification object] string];
	NSTableColumn* theColumn = [[self tableColumns] objectAtIndex:[self  
editedColumn]];


	[[self delegate] tableView:self setObjectValue:theString  
forTableColumn:theColumn row:[self selectedRow]];


[self abortEditing];// added
[[self window] makeFirstResponder:self];
}



--
S.O.S.


On 9 Apr 2008, at 10:51 pm, Graham Cox wrote:
How can I force a text cell in NSTableView to stop editing? On 10.4  
I could just tell the view's window to make the entire table the  
first responder and that did the trick, but on 10.5 this no longer  
works.


I'm trying to do this from within the textDidEndEditing:  
notification method so that I can suppress the table behaviour that  
goes to the next row and starts editing there - I just want the text  
to end editing on typing return and the table view to go back to its  
previous state - same row selected but no text being edited.



--
S.O.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/graham.cox%40bigpond.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]


Text with translucent Background

2008-04-09 Thread fred . redcliffe

Graham

Yes I am trying to draw it in a NSTextView. I tried what you suggested  
but it did not work. I played with multiple combinations of:


	[ textView setBackgroundColor:[ NSColor whiteColor ]/[ NSColor  
clearColor ]];

[ textView setDrawsBackground:NO/YES ];
and switching the textView isOpaque to on and off.

I would look forward to any other suggestions.

Thanks
Fred


On 9 Apr 2008, at 12:43, Graham Cox wrote:

How are you drawing the text? If it's in a NSTextView you also need  
to set the background colour of the view to clear, I believe, and  
maybe you'll need to override the IsOpaque method to return NO.


(I'm not that sure of myself here but I seem to recall something  
along these lines).



--
S.O.S.

On 9 Apr 2008, at 9:31 pm, [EMAIL PROTECTED] wrote:

Dear All

I am trying to set the background colour of a range of text in  
textview to a color with an alpha value less than 1.


I get the text storage and set its NSBackgroundColorAttributeName   
attribute  (through NSMutableAttributedString calls) to a colour  
with an alpha value less than 1.
However when this background draws it draws the colour as solid and  
as I decrease the alpha value( towards 0.0 )  the colour goes  
towards black.


Any suggestions

Thanks
Fred


___

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/graham.cox%40bigpond.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]


ToolTip for NSComboBox

2008-04-09 Thread Valentin Dan
Hi,

 

I’d like to know how I can add a toolTip for a NSComboBox; The text should be 
the stringValue of the item the mouse is hovering on (actually I need a toolTip 
for the items in the comboBox as they are too long to be displayed) .

 

The comboBox uses it’s own dataSource. 

 

Thanks!

 

___

Valentin Dan, Software Developer Direct: +1 905 886 1833 
ext.3047   

Email: HYPERLINK mailto:[EMAIL PROTECTED][EMAIL PROTECTED] 
Office: +40 356-710158

Masstech Group Inc.  Fax:+40 256-220912

HYPERLINK http://www.masstechgroup.com/http://www.masstechgroup.com 

 

THIS MESSAGE IS INTENDED ONLY FOR THE ADDRESSEE. IT MAY CONTAIN PRIVILEGED OR 
CONFIDENTIAL INFORMATION.ANY UNAUTHORIZED DISCLOSURE IS STRICTLY PROHIBITED.IF 
YOU HAVE RECEIVED THIS MESSAGE IN ERROR, PLEASE NOTIFY US IMMEDIATELY SO THAT 
WE MAY CORRECT THE RECORDS. PLEASE THEN DELETE THE ORIGINAL MESSAGE. THANK YOU.

 

 

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.519 / Virus Database: 269.22.10/1366 - Release Date: 08.04.2008 
17:03
 
___

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 to add number do Dock Icon like in Mail?

2008-04-09 Thread Samvel
It worked like a charm. It is so easy since I was trying to draw over  
existing Icon manually that is so complicated in comparison with given  
way of doing it.

Thanks, Samvel.

On Apr 8, 2008, at 7:41 AM, [EMAIL PROTECTED] wrote:



On leopard or later, you can just do:

[[[NSApplication sharedApplication] dockTile] setBadgeLabel: 
[[NSNumber numberWithInt:42] stringValue]];


to put 42 as a badge

Matt

On 8 Apr 2008, at 14:06, Adam P Jenkins wrote:
See [NSApplication setApplicationIconImage: (NSImage*)].  This  
changes the application's icon, and updates its dock icon.


On Mar 30, 2008, at 10:42 AM, Samvel wrote:

I'd like my application to show number of completed tasks in Dock  
Icon as it is done in Mail (number of unread emails). Anyone knows  
how to do that or where I can read about such functionality?





___

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: Layer-Hosting View on NSTabViewItem and switching Pages

2008-04-09 Thread Joachim Deelen

Me again,

I found a solution!

Im switching Tab-Pages with selectTabViewItemWithIdentifier: After  
switching, I sent a Notification that a switch occurred thereby  
stopping all animations and hiding the TextLayer. This was the first  
mistake. Now I send the notification first, then switching the Tab-Page.


The second mistake was: I hid the CATextLayer with setHidden:YES.  
But this triggers an implicit animation which takes some time.  So I  
had to disable animation first:


[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue  
forKey:kCATransactionDisableActions];

[textLayer setHidden:YES];
[CATransaction commit];

Now it works flawlessly

regards
Joachim


Am 09.04.2008 um 14:15 schrieb Joachim Deelen:


Hi All,

Maybe someone can Help Me?!

I've created a NSTabView with two Pages (NSTabViewItems). On the  
second Page I got a Custom-View, that is hosting a Layer-Tree. This  
tree consist of a CATextLayer, within a CAScrollLayer, within a  
CALayer. The CALayer is the Root-Layer of the View.


When I switch to the second Page, everything works as expected. But  
after switching back to the first Page, the Text within the  
CATextLayer remains displayed for about one second thereby  
disturbing the appearance of the first page.


I've tried to hide the View, before switching the pages. I stop  
every Animation of the Layers immediately before the switch actually  
happens. I even tried to set the opacity of the Layers to 0.0 (and  
called setNeedsDisplay) but to no avail.


Functionality of both Pages is as expected, but the short remains of  
the Text are really annoying.


regards
Joachim Deelen

AQUARIUS-software
http://www.aquarius-software.de



___

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/cocoa-dev%40deelen.de

This email sent to [EMAIL PROTECTED]


Joachim Deelen

AQUARIUS-software
http://www.aquarius-software.de



___

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: Saving NSFonts and changedFont: trouble

2008-04-09 Thread Thomas Backman

Hmm, I just noticed that if I do
[mainWindow makeFirstResponder:textView];

It never works. In other words, when the text view IS the first  
responder, it breaks. Otherwise, it seems to work great.
I'll be honest, I don't understand the responder chain, and I'm about  
to read through cocoa fundamentals, but: could somebody give me a hint  
how to intercept/receive the message sent directly to the textview?


TIA
/Thomas

On Apr 8, 2008, at 4:41 PM, Thomas Backman wrote:
Hey everybody. I'm working on a small app - to make the post  
shorter, lets just say that it displays (plain) text, but I want the  
user to be able to pick the font used (the same font should be used  
for all the text).
Right now, I have a changedFont: method in my controller class, that  
changes the font successfully, and saves the font+size as a string  
and float. First off, is there a better way to save things? There  
has to be. Anyway, that wasn't my main question. More importantly,  
this does work, until you click in the textview... When that  
happens, changedFont: is no longer called, and the font stays the  
same.

Why? (It works again after an app restart.)
I've tried setting the textview delegate, and a sharedFontManager  
delegate, to my controller. (Not sure about what I'm doing here, as  
you might have noticed)


I realize I'm short on info, but I'm not exactly sure what info to  
provide, so please ask if you need more.


TIA
Thomas
___

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/serenity 
%40exscape.org


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: core data and IB outlet binding

2008-04-09 Thread Torsten Curdt

No one a suggestion on how to track this down?

On Apr 9, 2008, at 12:31, Torsten Curdt wrote:

I have a custom NSCollectionViewItem

   @interface FilterViewItem : NSCollectionViewItem {

   IBOutlet NSTextField *filterExpression;

   }

   - (IBAction) applyFilter:(id)sender;

   @end

It's getting filled via core data just fine. Then I've also bound  
the filterExpression to the NSTextField in the prototype view. The  
same way the button is bound.


   @implementation FilterViewItem

   - (IBAction) applyFilter:(id)sender
   {
   NSString *expression = [filterExpression stringValue];

   NSLog(@expression %@, expression);

When the button is pressed it turns out that filterExpression (and  
therefor also the stringValue of it) is nil.


I assume somehow I could probably also get the value from the  
NSArrayController ...but


a) I am not sure how to get hold of the instance from within the  
FilterViewItem


b) I would need to get access to the NSTextField at some stage anyway

What am I missing here?


___

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:Text With Translucent Background

2008-04-09 Thread Lincoln Green
In my experience, the window containing the view in question has to  
have an alpha value of 99% or less to have a view show up as  
transparent.


- LG
___

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]


Tips to deploy applications to multiple Mac OS X versions

2008-04-09 Thread Lorenzo Bevilacqua

Hi,

I'm trying to build a Cocoa application so that it can run on Mac OS X  
from version 10.3.9 to 10.5.
I have 10.5 installed so the application runs fine on my system and on  
other Leopard systems.
I haven't build a project for multiple platforms yet, so I tried to  
duplicate the main Xcode target and set different deployment target  
settings like


myApp for Leopard   MACOSX_DEPLOYMENT_TARGET set to 10.5
myApp for Tiger MACOSX_DEPLOYMENT_TARGET set to 10.4
myApp for Panther   MACOSX_DEPLOYMENT_TARGET set to 10.3

The SDK I use is the Leopard one.

Till now all Ok, but when I try to compile for example the Tiger  
target I get some errors (mainly about fast enumeration). Thus I have  
some questions:


- It is correct to proceed like I described above?
- Does the Objective-C 2.0 fast enumeration make sense to be used? I  
mean, if I don't use it, will my application perform worse on Leopard?
- Is there a way to differentiate part of code by platform? I remember  
I saw in some files lines like this


#if MACOSX_DEPLOYMENT_TARGET == MAC_OS_X_VERSION_10_4
#endif

is this correct?


Thanks,

Lorenzo Bevilacqua
___

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: core data and IB outlet binding

2008-04-09 Thread Keary Suska
on 4/9/08 4:31 AM, [EMAIL PROTECTED] purportedly said:

 When the button is pressed it turns out that filterExpression (and
 therefor also the stringValue of it) is nil.
 
 I assume somehow I could probably also get the value from the
 NSArrayController ...but
 
 a) I am not sure how to get hold of the instance from within the
 FilterViewItem
 
 b) I would need to get access to the NSTextField at some stage anyway
 
 What am I missing here?

Is you outlet actually connected in IB? If it is properly connected, it
shouldn't be nil.

HTH,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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: Text with translucent Background

2008-04-09 Thread Robert Napier

Make sure the enclosing NSScrollView isn't drawing it's background:

[textView enclosingScrollView] setDrawsBackground:NO];

-Rob

--  
Rob Napier -- Software and Security Consulting -- http://robnapier.net


On Apr 9, 2008, at 9:39 AM, [EMAIL PROTECTED] wrote:

Graham

Yes I am trying to draw it in a NSTextView. I tried what you  
suggested but it did not work. I played with multiple combinations of:


	[ textView setBackgroundColor:[ NSColor whiteColor ]/[ NSColor  
clearColor ]];

[ textView setDrawsBackground:NO/YES ];
and switching the textView isOpaque to on and off.

I would look forward to any other suggestions.

Thanks
Fred


On 9 Apr 2008, at 12:43, Graham Cox wrote:

How are you drawing the text? If it's in a NSTextView you also need  
to set the background colour of the view to clear, I believe, and  
maybe you'll need to override the IsOpaque method to return NO.


(I'm not that sure of myself here but I seem to recall something  
along these lines).



--
S.O.S.

On 9 Apr 2008, at 9:31 pm, [EMAIL PROTECTED] wrote:

Dear All

I am trying to set the background colour of a range of text in  
textview to a color with an alpha value less than 1.


I get the text storage and set its NSBackgroundColorAttributeName   
attribute  (through NSMutableAttributedString calls) to a colour  
with an alpha value less than 1.
However when this background draws it draws the colour as solid  
and as I decrease the alpha value( towards 0.0 )  the colour goes  
towards black.


Any suggestions

Thanks
Fred


___

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/graham.cox%40bigpond.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/robnapier%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: core data and IB outlet binding

2008-04-09 Thread Torsten Curdt

On Apr 9, 2008, at 17:06, Keary Suska wrote:

on 4/9/08 4:31 AM, [EMAIL PROTECTED] purportedly said:


When the button is pressed it turns out that filterExpression (and
therefor also the stringValue of it) is nil.

I assume somehow I could probably also get the value from the
NSArrayController ...but

a) I am not sure how to get hold of the instance from within the
FilterViewItem

b) I would need to get access to the NSTextField at some stage anyway

What am I missing here?


Is you outlet actually connected in IB? If it is properly connected,  
it

shouldn't be nil.


Yeah ...that's connected. Which is why I am so surprised it's nil.

Thanks for the response.

cheers
--
Torsten
___

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: Text with translucent Background

2008-04-09 Thread fred . redcliffe
Still no luck. When I switch off the background of the scrollview the  
gray of the window in my test project comes through so it is clear all  
backgrounds are not being drawn but the selection colour still behaves  
in exactly the same way and draws in a solid colour.


Thanks
Fred


On 9 Apr 2008, at 16:08, Robert Napier wrote:


Make sure the enclosing NSScrollView isn't drawing it's background:

[textView enclosingScrollView] setDrawsBackground:NO];

-Rob

-- Rob Napier -- Software and Security Consulting -- http://robnapier.net

On Apr 9, 2008, at 9:39 AM, [EMAIL PROTECTED] wrote:

Graham

Yes I am trying to draw it in a NSTextView. I tried what you  
suggested but it did not work. I played with multiple combinations  
of:


	[ textView setBackgroundColor:[ NSColor whiteColor ]/[ NSColor  
clearColor ]];

[ textView setDrawsBackground:NO/YES ];
and switching the textView isOpaque to on and off.

I would look forward to any other suggestions.

Thanks
Fred


On 9 Apr 2008, at 12:43, Graham Cox wrote:

How are you drawing the text? If it's in a NSTextView you also  
need to set the background colour of the view to clear, I believe,  
and maybe you'll need to override the IsOpaque method to return NO.


(I'm not that sure of myself here but I seem to recall something  
along these lines).



--
S.O.S.

On 9 Apr 2008, at 9:31 pm, [EMAIL PROTECTED] wrote:

Dear All

I am trying to set the background colour of a range of text in  
textview to a color with an alpha value less than 1.


I get the text storage and set its  
NSBackgroundColorAttributeName  attribute  (through  
NSMutableAttributedString calls) to a colour with an alpha value  
less than 1.
However when this background draws it draws the colour as solid  
and as I decrease the alpha value( towards 0.0 )  the colour goes  
towards black.


Any suggestions

Thanks
Fred


___

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/graham.cox%40bigpond.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/robnapier 
%40gmail.com


This email sent to [EMAIL PROTECTED]




Reza Farhad
---
Urban Design Limited
[EMAIL PROTECTED]
+44 (0)7795 430094




___

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: fileHFSCreatorCode fileAttributesAtPath:traverseLink on app bundles

2008-04-09 Thread Douglas Davidson


On Apr 8, 2008, at 6:37 PM, Mike wrote:

If you really are using NSDirectoryEnumerator to scan a large  
hierarchy for applications, be sure to use an inner auto-release  
pool to clean up intermediate objects as you go.  Also, once you  
detect that a path corresponds to a bundle (+[NSBundle  
bundleWithPath:] returns non-nil), use -[NSDirectoryEnumerator  
skipDescendents] to avoid enumerating the contents of the bundle --  
unless you're really interested in applications buried inside of  
other applications, it will just be wasted time.


Yeah, I found that out the hard way. I just check for bundle or .app  
and when I hit one, I immediately check its creator code. If it's  
not the one I want, I skip descendents and it works fine. Before  
that it would iterate everything and when it hit a huge app like  
Garageband it would take forever. And I am enumerating from the vol.  
root.


I should point out that checking whether [NSBundle bundleWithPath:]  
returns non-nil is probably not what you want.  You can create an  
NSBundle from any readable directory, and it will operate using  
whatever bundle structures are present within that directory.  More  
likely what you are interested in is whether a particular directory is  
a file package, i.e., whether it is intended to be presented to the  
user as a single opaque object; this information can be obtained from  
NSWorkspace or Launch Services, which can also provide additional  
information such as whether a particular directory represents an  
application.  Looking for an extension such as .app is not necessarily  
reliable for this purpose.


Douglas Davidson

___

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]


some questions about creating image thumbnails

2008-04-09 Thread Jesse Grosjean
I have a situation where I've got a NSImage reference in memory and  
I'd like to save that image at full size and in a number of thumbnail  
sizes as quickly as possible. I know how to implement the basics, but  
I have no idea if I'm doing it in the most efficient way. In particular:


To save the full sizes image I'm using some code like this:

	[[artworkImage  
TIFFRepresentationUsingCompression:NSTIFFCompressionNone factor:0]  
writeToFile:file atomically:NO]


That brings up these questions:

1. If I don't care about on disk size is NSTIFFCompressionNone a fast  
way to write? (assuming that compression would take more time). Or  
maybe compression will actually save me time since the disk write will  
be faster?
2. And how does the image format effect read time, after all that's  
what I'm really trying to optimize in the first place by creating the  
caches?
2. Is TIFFRepresentation a good way to go or should I really be using  
some other framework like image IO or something else if I'm concerned  
with efficiency.


For the thumbnails I'm just creating new NSImages of the correct size,  
locking focus on them, and then drawing the original image into the  
smaller image, and writing them out as above. Is there a smarter way?  
I've heard (or maybe imagined) that some image file formats will  
already embed their own thumbnails. Is that a better way to do  
things... what image formats support that if any?


Thanks for any pointers.

Jesse
___

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: Text with translucent Background

2008-04-09 Thread Douglas Davidson


On Apr 9, 2008, at 8:28 AM, [EMAIL PROTECTED] wrote:

Still no luck. When I switch off the background of the scrollview  
the gray of the window in my test project comes through so it is  
clear all backgrounds are not being drawn but the selection colour  
still behaves in exactly the same way and draws in a solid colour.


The selection color and text background are currently drawn without  
opacity.  We are aware of this limitation and hope to remove it in a  
future version.  It is possible that you could alter this behavior  
yourself by overriding the NSLayoutManager method used for background  
drawing.


Douglas Davidson

___

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: Programmatic binding not working both ways?

2008-04-09 Thread Keary Suska
on 4/8/08 9:16 PM, [EMAIL PROTECTED] purportedly said:

 I'm using bind:toObject:withKeyPath:options: to programmatically set up
 bindings from a set of proxy objects (the receiver) to various properties on
 a model object, and while changes to the model properties are properly being
 reflected in the proxies, changes to the proxy properties are not being
 propagated back to the model as I expect.

IIRC, bindings are only one-way. The two-way behavior you have seen is a
function of NSObjectController and its subclasses. Your proxy objects will
have to somehow communicate their changes to the model manually or using
KVO.

HTH,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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: core data and IB outlet binding

2008-04-09 Thread Mike R. Manzano
Are you sure you're calling applyFilter after or during awakeFromNib?  
i.e., you're not calling applyFilter in some sort of -init, right?


Mike


On Apr 9, 2008, at 3:31 AM, Torsten Curdt wrote:


I have a custom NSCollectionViewItem

   @interface FilterViewItem : NSCollectionViewItem {

   IBOutlet NSTextField *filterExpression;

   }

   - (IBAction) applyFilter:(id)sender;

   @end

It's getting filled via core data just fine. Then I've also bound  
the filterExpression to the NSTextField in the prototype view. The  
same way the button is bound.


   @implementation FilterViewItem

   - (IBAction) applyFilter:(id)sender
   {
   NSString *expression = [filterExpression stringValue];

   NSLog(@expression %@, expression);

When the button is pressed it turns out that filterExpression (and  
therefor also the stringValue of it) is nil.


I assume somehow I could probably also get the value from the  
NSArrayController ...but


a) I am not sure how to get hold of the instance from within the  
FilterViewItem


b) I would need to get access to the NSTextField at some stage anyway

What am I missing here?

cheers
--
Torsten

___

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/alephx01%40mac.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: core data and IB outlet binding

2008-04-09 Thread Keary Suska
on 4/9/08 9:14 AM, [EMAIL PROTECTED] purportedly said:

 On Apr 9, 2008, at 17:06, Keary Suska wrote:
 on 4/9/08 4:31 AM, [EMAIL PROTECTED] purportedly said:
 
 When the button is pressed it turns out that filterExpression (and
 therefor also the stringValue of it) is nil.
 
 I assume somehow I could probably also get the value from the
 NSArrayController ...but
 
 a) I am not sure how to get hold of the instance from within the
 FilterViewItem
 
 b) I would need to get access to the NSTextField at some stage anyway
 
 What am I missing here?
 
 Is you outlet actually connected in IB? If it is properly connected,
 it
 shouldn't be nil.
 
 Yeah ...that's connected. Which is why I am so surprised it's nil.

Well, AFAIK it's not possible for an outlet to be nil, as long as the object
with the outlet is instantiated in the nib or is the file's owner.
Otherwise, the outlet will never be set.

Have you put an NSLog in the object's awakeFromNib to make sure your object
is involved in the nib and the outlet is being set?

Best,

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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: Open-source NSToolbar?

2008-04-09 Thread John Stiles
This is very cool and I would have used it if I had known about it 
earlier, but it isn't a replacement for NSToolbar so much as a simpler 
way to create one (which is awesome and should have been there all along).



Geoff Beier wrote:

On Tue, Apr 8, 2008 at 12:25 PM, John Stiles [EMAIL PROTECTED] wrote:
  

Well, I was thinking more along the lines of an RBSplitView, something you
can just drop into your nib/code and suddenly your toolbars are better :)



Is this what you're looking for? IB3 seems to have it natively, and
this does it for IB2:
http://belkadan.com/generictoolbar/

HTH

Geoff
  

___

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

2008-04-09 Thread Corbin Dunn


On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:
	What advantage does NSUinteger have over uint32?   I realize that  
on a 64 bit machine, it would be a uint64.


I think everyone is missing the point. The advantage is not None.

Chris Parker already gave the first good advantage. The second is  
this: Use NSInteger/NSUInteger everywhere in your app. Recompile it  
for 64-bit and you instantly have a fully 64-bit version with very  
little work. That's a huge advantage.


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


Re: NSUInteger question

2008-04-09 Thread Michael Ash
On Wed, Apr 9, 2008 at 12:30 PM, Corbin Dunn [EMAIL PROTECTED] wrote:

  On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:

 What advantage does NSUinteger have over uint32?   I realize that
 on a 64 bit machine, it would be a uint64.
 

  I think everyone is missing the point. The advantage is not None.

  Chris Parker already gave the first good advantage. The second is this: Use
 NSInteger/NSUInteger everywhere in your app. Recompile it for 64-bit and you
 instantly have a fully 64-bit version with very little work. That's a huge
 advantage.

But the same effect could be had simply by using long and unsigned
long. If those are not well defined enough for you then you can use
the types in stdint.h or sys/types.h so that you can pick a type which
means exactly what you want. For example, if you're worried about
future compatibility on an LLP64 system, intptr_t and uintptr_t are
essentially equivalent to NS[U]Integer in meaning.

My understanding is that the main advantage of NS[U]Integer is that
it's still an int, not a long, on 32-bit. While the two types are
essentially identical in the 32-bit world, they do have different
@encode strings, so using NS[U]Integer avoids changing the signatures
of methods which existed prior to 10.5.

IMO it's dangerous to talk about a 64-bit conversion in this manner.
Much like any other architecture change, there are a lot of different
effects and blindly using safe types is not guaranteed to make your
app work after a recompile. Likewise an application which uses
non-NSInteger types may be written to Just Work when recompiled as
64-bit.

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: some questions about creating image thumbnails

2008-04-09 Thread Nathan Vander Wilt

On Apr 9, 2008, at 8:32 AM, Jesse Grosjean wrote:
 I've heard (or maybe imagined) that some image file formats will  
already embed their own thumbnails. Is that a better way to do  
things... what image formats support that if any?


This I do know a bit better. TIFF images can indeed store multiple  
representations, and it seems NSImage is well suited to using those  
representations.


You might consider PNG as well. It cannot store multiple  
representations in one file, but it can compress many screen graphics  
(think screenshots of a typical application window and such) better  
than TIFF compressions while still keeping the original pixels.


JPEG and other (usually unwritable) camera formats can store a  
thumbnail in their metadata, but I wouldn't recommend going that  
route. Not the only reason, but unless you're dealing with  
photographic material JPEG's lossy compression will not likely be  
suited to your needs.


hope this helps,
-natevw
___

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: some questions about creating image thumbnails

2008-04-09 Thread Nathan Vander Wilt

On Apr 9, 2008, at 8:32 AM, Jesse Grosjean wrote:
1. If I don't care about on disk size is NSTIFFCompressionNone a  
fast way to write? (assuming that compression would take more time).  
Or maybe compression will actually save me time since the disk write  
will be faster?


I am by no means a performance expert (is anyone besides Shark?) but I  
suspect that nowadays you would much rather do a bit of extra work in  
CPU/memory than extra hauling from the hard drive. You'd want to  
confirm this yourself in a small prototype that kinda mimics the  
behaviour of your application, except many times over. Watch out for  
both NSImage and disk caching, though. If you oversimplify your code  
by (say) loading the same image over and over, your prototype might  
not end up mimicking your app correctly.


Anyway, I haven't experimented with this much myself, so I should let  
someone else give you a real answer!


-natevw
___

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

2008-04-09 Thread Chris Parker


On 8 Apr 2008, at 6:19 PM, Christopher Nebel wrote:

On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:

What advantage does NSUinteger have over uint32?   I realize that  
on a 64 bit machine, it would be a uint64.


Advantage?  None, really.  It's a question of what you're trying  
to express -- do you want specifically a 32-bit unsigned integer, or  
do you want an unsigned integer that reflects the architecture's  
word size?  For instance, there's no particular reason to limit  
NSArray's capacity to exactly 2^32 items all the time, so -count is  
defined as returning an NSUInteger -- 2^32 in 32-bit, or 2^64 in 64- 
bit.  (Also consider the analogous size_t type.)


Well, that and this:

The advantage is not having to do something like this:

#if __LP64__
- (int)someMethodWhichTakes:(int)foo;
#else
- (int64_t)someMethodWhichTakes:(int64_t)foo;
#endif

and sprinkle those all over the place later too...

This:

- (NSInteger)someMethodWhichTakes:(NSInteger)foo;

is far more readable. :)

.chris

___

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: Tips to deploy applications to multiple Mac OS X versions

2008-04-09 Thread Michael Vannorsdel
Using Obj-C 2.0 can give a little speed boost over previous versions  
of Mac OS X.  For building for other system versions sometimes you  
need to link to the SDK of that version if you find some symbols are  
missing (depreciated or removed).  If you want to use certain features  
on one platform and not another you can use the #if statements.


#if MACOSX_DEPLOYMENT_TARGET == MAC_OS_X_VERSION_10_4

/* 10.4 code here */

#else

/* code for all others */

#endif


On Apr 9, 2008, at 8:43 AM, Lorenzo Bevilacqua wrote:

I'm trying to build a Cocoa application so that it can run on Mac OS  
X from version 10.3.9 to 10.5.
I have 10.5 installed so the application runs fine on my system and  
on other Leopard systems.
I haven't build a project for multiple platforms yet, so I tried to  
duplicate the main Xcode target and set different deployment target  
settings like


myApp for Leopard   MACOSX_DEPLOYMENT_TARGET set to 10.5
myApp for Tiger MACOSX_DEPLOYMENT_TARGET set to 10.4
myApp for Panther   MACOSX_DEPLOYMENT_TARGET set to 10.3

The SDK I use is the Leopard one.

Till now all Ok, but when I try to compile for example the Tiger  
target I get some errors (mainly about fast enumeration). Thus I  
have some questions:


- It is correct to proceed like I described above?
- Does the Objective-C 2.0 fast enumeration make sense to be used? I  
mean, if I don't use it, will my application perform worse on Leopard?
- Is there a way to differentiate part of code by platform? I  
remember I saw in some files lines like this


#if MACOSX_DEPLOYMENT_TARGET == MAC_OS_X_VERSION_10_4
#endif

is this correct?


___

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: Saving NSFonts and changedFont: trouble

2008-04-09 Thread Todd Ransom

Thomas,

The responder chain is really the key to your question. The text view  
is getting the changeFont: message instead of your controller once it  
gets focus. How are you implementing the control that lets your user  
change fonts? Do you have a separate button/control for that or are  
you relying on the user to do it using the font panel?


If you want the user to do it using the font panel you can either  
override -[NSTextView changeFont:] to save the value and call super's  
implementation or you can implement the delegate method  
textView:shouldChangeTextInRange:replacementString: When the  
replacement string passed into this method is nil it means only  
attributes were changed in the text view. If it is an empty string it  
means some text was removed. Note that there are also other methods in  
NSTextView for other changes that you may also need to override  
(changeColor:, changeAttributes:) if you want to capture more than  
just font changes.


If you have a separate control for this you should not be messing with  
these methods at all, just write a method that will save the new font  
and apply to the text view.


Todd Ransom
Return Self Software
http://returnself.com



On Apr 9, 2008, at 10:25 AM, Thomas Backman wrote:

Hmm, I just noticed that if I do
   [mainWindow makeFirstResponder:textView];

It never works. In other words, when the text view IS the first  
responder, it breaks. Otherwise, it seems to work great.
I'll be honest, I don't understand the responder chain, and I'm  
about to read through cocoa fundamentals, but: could somebody give  
me a hint how to intercept/receive the message sent directly to the  
textview?


TIA
/Thomas

On Apr 8, 2008, at 4:41 PM, Thomas Backman wrote:
Hey everybody. I'm working on a small app - to make the post  
shorter, lets just say that it displays (plain) text, but I want  
the user to be able to pick the font used (the same font should be  
used for all the text).
Right now, I have a changedFont: method in my controller class,  
that changes the font successfully, and saves the font+size as a  
string and float. First off, is there a better way to save things?  
There has to be. Anyway, that wasn't my main question. More  
importantly, this does work, until you click in the textview...  
When that happens, changedFont: is no longer called, and the font  
stays the same.

Why? (It works again after an app restart.)
I've tried setting the textview delegate, and a sharedFontManager  
delegate, to my controller. (Not sure about what I'm doing here, as  
you might have noticed)


I realize I'm short on info, but I'm not exactly sure what info to  
provide, so please ask if you need more.


TIA
Thomas
___

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/serenity%40exscape.org

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/toddransom%40mac.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: Saving NSFonts and changedFont: trouble

2008-04-09 Thread Michael Vannorsdel

The responder chain works something like this:

user event-active application-application's key window-window's  
first responder if accepts, otherwise next view in line gets it.   
Whether or not delegate messages are sent is upto one of the  
responders in the chain to send them.


The only sure way of intercepting messages to the textview is to make  
your own subclass of it and use that, overriding various methods.



On Apr 9, 2008, at 8:25 AM, Thomas Backman wrote:


Hmm, I just noticed that if I do
   [mainWindow makeFirstResponder:textView];

It never works. In other words, when the text view IS the first  
responder, it breaks. Otherwise, it seems to work great.
I'll be honest, I don't understand the responder chain, and I'm  
about to read through cocoa fundamentals, but: could somebody give  
me a hint how to intercept/receive the message sent directly to the  
textview?


___

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]


System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-09 Thread Dave Camp
After designing the UI for a new System Preferences pane I've  
discovered that the window size in Leopard is 75 pixels wider than it  
was in Tiger or earlier OS releases. The net result appears to be that  
my shiny new UI is clipped on the right side in Tiger. Ugh. I've sent  
feedback that the docs are incorrect here and need to be updated...


In the mean time, what is the correct way to handle this?

From what I've read on the net adding springs in IB doesn't help.  
Would it be safe for me to resize the preferences window to be 75  
pixels wider on Tiger while my pane is visible (and size it back down  
when my pane is deselected)?


Do I have to make my UI narrower and have an obnoxious amount of dead  
space around the edges on Leopard?


Thoughts?

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: some questions about creating image thumbnails

2008-04-09 Thread Adam R. Maxwell
 
On Wednesday, April 09, 2008, at 08:35AM, Jesse Grosjean [EMAIL PROTECTED] 
wrote:
I have a situation where I've got a NSImage reference in memory and  
I'd like to save that image at full size and in a number of thumbnail  
sizes as quickly as possible. I know how to implement the basics, but  
I have no idea if I'm doing it in the most efficient way. In particular:

To save the full sizes image I'm using some code like this:

   [[artworkImage  
TIFFRepresentationUsingCompression:NSTIFFCompressionNone factor:0]  
writeToFile:file atomically:NO]

That brings up these questions:

1. If I don't care about on disk size is NSTIFFCompressionNone a fast  
way to write? (assuming that compression would take more time). Or  
maybe compression will actually save me time since the disk write will  
be faster?

You really need to use Shark to figure this out for your use case.  In my 
testing, compressing image data with zlib at the lowest compression level was a 
big win over zero compression in overall time spent to create an image, just 
because of the smaller reads.

2. And how does the image format effect read time, after all that's  
what I'm really trying to optimize in the first place by creating the  
caches?
2. Is TIFFRepresentation a good way to go or should I really be using  
some other framework like image IO or something else if I'm concerned  
with efficiency.

Again, Shark will tell you if it's significant.  Using ImageIO will require you 
to use CGImage, so you'd incur some additional overhead creating NSImages from 
CGImages.

If you want lossless compression, PNG is good quality, but may be slow; same 
story for JPEG2000.  I have performance problems drawing Finder icons that are 
apparently compressed internally as JPEG2000, so my suspicion is that it might 
be slow across the board.  But don't take my word for it: use Shark :).

For the thumbnails I'm just creating new NSImages of the correct size,  
locking focus on them, and then drawing the original image into the  
smaller image, and writing them out as above. Is there a smarter way?  

If you want more control, you could use CoreImage with a Lanczos filter, or use 
vImage on an NSBitmapImageRep.  I'm using vImage for my thumbnail scaling, but 
it ended up being nontrivial.  E-mail me offlist if you want the link; it's a 
BSD licensed framework for a grid view of images, with code for multithreaded 
scaling and creating/saving/loading thumbnails, mainly optimized for memory 
usage.

hth,
Adam
___

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

2008-04-09 Thread Corbin Dunn


On Apr 9, 2008, at 9:39 AM, Michael Ash wrote:
On Wed, Apr 9, 2008 at 12:30 PM, Corbin Dunn [EMAIL PROTECTED]  
wrote:


On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:

  What advantage does NSUinteger have over uint32?   I realize  
that

on a 64 bit machine, it would be a uint64.




I think everyone is missing the point. The advantage is not None.

Chris Parker already gave the first good advantage. The second is  
this: Use
NSInteger/NSUInteger everywhere in your app. Recompile it for 64- 
bit and you
instantly have a fully 64-bit version with very little work. That's  
a huge

advantage.


But the same effect could be had simply by using long and unsigned
long.


No, the same effect could not have been done, for one of the reasons  
you mention below.



If those are not well defined enough for you then you can use
the types in stdint.h or sys/types.h so that you can pick a type which
means exactly what you want. For example, if you're worried about
future compatibility on an LLP64 system, intptr_t and uintptr_t are
essentially equivalent to NS[U]Integer in meaning.

My understanding is that the main advantage of NS[U]Integer is that
it's still an int, not a long, on 32-bit. While the two types are
essentially identical in the 32-bit world, they do have different
@encode strings, so using NS[U]Integer avoids changing the signatures
of methods which existed prior to 10.5.


Yes, this is true.





IMO it's dangerous to talk about a 64-bit conversion in this manner.


I disagree. It eases transition for apps that use the NSInteger type.  
Please read our release notes on the subject:


http://developer.apple.com/releasenotes/Cocoa/Foundation.html#64Bit

and the documentation:

http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/Introduction/chapter_1_section_1.html



Much like any other architecture change, there are a lot of different
effects and blindly using safe types is not guaranteed to make your
app work after a recompile.


Yes; there are many cases where blindly using NSInteger/NSUInteger can  
get you unexpected results. But, we document the typical pitfalls, and  
they are easy to avoid. Certain apps (like TextEdit) can simply be  
recompiled.



Likewise an application which uses
non-NSInteger types may be written to Just Work when recompiled as
64-bit.


That is true too. You can easily recompile an app that uses int/float  
and still having it do most of its computations with 32-bit values, or  
use appropriate types where applicable. But that isn't a full 64-bit  
app unless you convert all uses of int to a larger type. You wouldn't  
write this on 32-bit:


for (short i = 0; i  ..; i++)

And similarly, you shouldn't write this on 64-bit:

for (int i = 0; i  ..; i++)

If you are using any Cocoa API's you should be using NSInteger/ 
NSUInteger, and not doing so would require much more work.


The question was what advantage is there for using NSInteger/ 
NSUInteger. The answer is 64-bit transition of your Cocoa apps.


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


Re: Saving NSFonts and changedFont: trouble

2008-04-09 Thread Thomas Backman
Thanks! That worked indeed. I went the subclass route. In case someone  
stumbles upon this via google, my solution was (in my NSTextView  
subclass):

- (void)changeFont:(id)sender {
NSFont *oldFont = [self font];
NSFont *newFont = [sender convertFont:oldFont];
[self setFont:newFont];
// save newFont to defaults here... 
[super changeFont:sender];
}

/Thomas

On Apr 9, 2008, at 6:55 PM, Todd Ransom wrote:

Thomas,

The responder chain is really the key to your question. The text  
view is getting the changeFont: message instead of your controller  
once it gets focus. How are you implementing the control that lets  
your user change fonts? Do you have a separate button/control for  
that or are you relying on the user to do it using the font panel?


If you want the user to do it using the font panel you can either  
override -[NSTextView changeFont:] to save the value and call  
super's implementation or you can implement the delegate method  
textView:shouldChangeTextInRange:replacementString: When the  
replacement string passed into this method is nil it means only  
attributes were changed in the text view. If it is an empty string  
it means some text was removed. Note that there are also other  
methods in NSTextView for other changes that you may also need to  
override (changeColor:, changeAttributes:) if you want to capture  
more than just font changes.


If you have a separate control for this you should not be messing  
with these methods at all, just write a method that will save the  
new font and apply to the text view.


Todd Ransom
Return Self Software
http://returnself.com



On Apr 9, 2008, at 10:25 AM, Thomas Backman wrote:

Hmm, I just noticed that if I do
  [mainWindow makeFirstResponder:textView];

It never works. In other words, when the text view IS the first  
responder, it breaks. Otherwise, it seems to work great.
I'll be honest, I don't understand the responder chain, and I'm  
about to read through cocoa fundamentals, but: could somebody give  
me a hint how to intercept/receive the message sent directly to the  
textview?


TIA
/Thomas

On Apr 8, 2008, at 4:41 PM, Thomas Backman wrote:
Hey everybody. I'm working on a small app - to make the post  
shorter, lets just say that it displays (plain) text, but I want  
the user to be able to pick the font used (the same font should be  
used for all the text).
Right now, I have a changedFont: method in my controller class,  
that changes the font successfully, and saves the font+size as a  
string and float. First off, is there a better way to save things?  
There has to be. Anyway, that wasn't my main question. More  
importantly, this does work, until you click in the textview...  
When that happens, changedFont: is no longer called, and the font  
stays the same.

Why? (It works again after an app restart.)
I've tried setting the textview delegate, and a sharedFontManager  
delegate, to my controller. (Not sure about what I'm doing here,  
as you might have noticed)


I realize I'm short on info, but I'm not exactly sure what info to  
provide, so please ask if you need more.


TIA
Thomas



___

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]


[OFF] unicode characters

2008-04-09 Thread Alexander Cohen
Sorry for the off-topic post but this is the best place to get info  
( lots of smart people ).


I have a string that is composed unicode characters. I want to be able  
to transform that string into all ascii characters by transforming all  
non-ascii characters into their ascii equivalent.


ex:

ü = u
é = e

Anyone know of a way to do that or do i need a lookup table with all  
characters and their equivalents?


thx

AC___

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: System Preferences window is wider in Leopard? How do you make a Tiger compatible UI?

2008-04-09 Thread slasktrattenator
Try this. The firstRun variable makes sure the pane is only resized
once, or System Preferences will crash. Hope this helps.

- (NSView *) mainView {
// Return a different sized view for each version of OS X
// Leopard has a wider system prefs window than Tiger
// Include the Carbon framework for the Gestalt function
SInt32 MacOSXVersionNumber;
if (Gestalt(gestaltSystemVersion, MacOSXVersionNumber) == noErr) {
if (MacOSXVersionNumber = 0x01050) {
if (firstRun == YES) {
[prefWindow setContentSize:NSMakeSize(594.0, 354.0)];
// Resize for Tiger
firstRun = NO;
}
}
}
return [super mainView];
}

On Wed, Apr 9, 2008 at 7:06 PM, Dave Camp [EMAIL PROTECTED] wrote:
 After designing the UI for a new System Preferences pane I've discovered
 that the window size in Leopard is 75 pixels wider than it was in Tiger or
 earlier OS releases. The net result appears to be that my shiny new UI is
 clipped on the right side in Tiger. Ugh. I've sent feedback that the docs
 are incorrect here and need to be updated...

  In the mean time, what is the correct way to handle this?

  From what I've read on the net adding springs in IB doesn't help. Would it
 be safe for me to resize the preferences window to be 75 pixels wider on
 Tiger while my pane is visible (and size it back down when my pane is
 deselected)?

  Do I have to make my UI narrower and have an obnoxious amount of dead space
 around the edges on Leopard?

  Thoughts?

  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/slasktrattenator%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]


what is the proper place to store application settings

2008-04-09 Thread Laimonas Simutis
Hey,

I started programming with Cocoa recently. Created an application
which makes REST calls and displays the response values in a simple
window. For each particular REST function I have a corresponding class
which defines functionality for constructing a proper URL needed to
call a function, initiating the call and informing the interested
delegate object once the REST response is received.

Right now I have the host part of the url hardcoded in each class that
represents a different REST function call. I know I should store it in
one place, not sure what's the recommended place in cocoa apps. I
was thinking maybe one class with #defines and then all the REST
representing classes would include that? Also I see some docs
mentioning plist setting files, could that be a better place? Based on
my environment (debug, testing, prod) this url will change as well.

Thanks for any recommendations,

L
___

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: [OFF] unicode characters

2008-04-09 Thread Douglas Davidson


On Apr 9, 2008, at 11:14 AM, Alexander Cohen wrote:

Sorry for the off-topic post but this is the best place to get info  
( lots of smart people ).


I have a string that is composed unicode characters. I want to be  
able to transform that string into all ascii characters by  
transforming all non-ascii characters into their ascii equivalent.


ex:

ü = u
é = e

Anyone know of a way to do that or do i need a lookup table with all  
characters and their equivalents?


Take a look at CFStringTransform().  The details will depend on  
exactly what you want to do.


Douglas Davidson

___

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: what is the proper place to store application settings

2008-04-09 Thread Jeff LaMarche
I'm assuming that these will change, but should not be changed by the  
user, correct?


It seems to me that you'd want to avoid compiling them into your  
classes using #define, I think a property list included as bundle  
resource is the way to go.


http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/PropertyLists.html

On Apr 9, 2008, at 2:19 PM, Laimonas Simutis wrote:


I started programming with Cocoa recently. Created an application
which makes REST calls and displays the response values in a simple
window. For each particular REST function I have a corresponding class
which defines functionality for constructing a proper URL needed to
call a function, initiating the call and informing the interested
delegate object once the REST response is received.

Right now I have the host part of the url hardcoded in each class that
represents a different REST function call. I know I should store it in
one place, not sure what's the recommended place in cocoa apps. I
was thinking maybe one class with #defines and then all the REST
representing classes would include that? Also I see some docs
mentioning plist setting files, could that be a better place? Based on
my environment (debug, testing, prod) this url will change as well.

Thanks for any recommendations,


___

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]


looking for sample code to read UUID from a disk volume.

2008-04-09 Thread Kenny Leung

Hi All.

I can see from diskutil that a volume has a UUID:

[EMAIL PROTECTED]diskutil info /

   Device Node:/dev/disk0s3
   Device Identifier:  disk0s3
   Mount Point:/
   Volume Name:Tiger

   File System:Journaled HFS+
   Journal size 16384 k at offset 0x3e
   Owners: Enabled
   Partition Type: Apple_HFS
   Bootable:   Is bootable
   Media Type: Generic
   Protocol:   SATA
   SMART Status:   Verified
   UUID:   00826A1E-B3EB-3764-8CB0-867AFBB0FF83
   Total Size: 123.7 GB
   Free Space: 9.7 GB
   Read Only:  No
   Ejectable:  No

I am looking for sample code to obtain the UUID. Any pointers are  
greatly appreciated!


-Kenny

___

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: looking for sample code to read UUID from a disk volume.

2008-04-09 Thread Herb Petschauer
There may well be sample code to do this, but I initially learned to
do this from IORegistryExplorer.app (which is open sourced under
Darwin, IOKitTools).  For all I know diskutil is in Darwin as well...

Do an ioreg -l in your Terminal window, search on UUID.  Note that
each volume/partition has something like :

| |   | +-o [EMAIL PROTECTED]  class IOMedia,
registered, matched, active, busy 0, retain count 9
| |   | | | {
| |   | | |   Leaf = Yes
| |   | | |   Writable = Yes
| |   | | |   BSD Minor = 2
| |   | | |   IOBusyInterest = IOCommand is not
serializable
| |   | | |   Partition ID = 2
| |   | | |   Preferred Block Size = 512
| |   | | |   UUID = some value

Now, I found the same info in IORegistryExplorer by exploring
IODeviceTree/[EMAIL PROTECTED]/SATA  (etc, etc).  If IORegistryExplorer can
display it then you can find out how as well.

The IORegistryEntryXXX routines are your friends (IOKitLib.h in the
IOKit framework).

If someone posts with sample code, then bonus ;-)

And note that only a GUID partition table scheme will yield partitions
with a UUID.  The old style Apple Partition Map will not (so any
legacy or even current PPC machines).

Cheers,
-H.


On 09/04/2008, Kenny Leung [EMAIL PROTECTED] wrote:
 Hi All.

  I can see from diskutil that a volume has a UUID:

  [EMAIL PROTECTED]diskutil info /

Device Node:/dev/disk0s3
Device Identifier:  disk0s3
Mount Point:/
Volume Name:Tiger

File System:Journaled HFS+
Journal size 16384 k at offset 0x3e
Owners: Enabled
Partition Type: Apple_HFS
Bootable:   Is bootable
Media Type: Generic
Protocol:   SATA
SMART Status:   Verified
UUID:   00826A1E-B3EB-3764-8CB0-867AFBB0FF83
Total Size: 123.7 GB
Free Space: 9.7 GB
Read Only:  No
Ejectable:  No

  I am looking for sample code to obtain the UUID. Any pointers are greatly
 appreciated!

  -Kenny

  ___

  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/bogvardi%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: what is the proper place to store application settings

2008-04-09 Thread I. Savant
On Wed, Apr 9, 2008 at 2:41 PM, Jeff LaMarche [EMAIL PROTECTED] wrote:
 I'm assuming that these will change, but should not be changed by the user,
 correct?

  It seems to me that you'd want to avoid compiling them into your classes
 using #define, I think a property list included as bundle resource is the
 way to go.


 http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/PropertyLists.html

  I really think the user preferences system is the best choice here.
That way, a software update isn't necessary if the URL changes and
users can change it themselves if necessary.

  Search the documentation for NSUserDefaults.

--
I.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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSUInteger question

2008-04-09 Thread Michael Ash
On Wed, Apr 9, 2008 at 1:43 PM, Corbin Dunn [EMAIL PROTECTED] wrote:

  On Apr 9, 2008, at 9:39 AM, Michael Ash wrote:

  On Wed, Apr 9, 2008 at 12:30 PM, Corbin Dunn [EMAIL PROTECTED] wrote:
 
  
   On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:
  
  
 What advantage does NSUinteger have over uint32?   I realize that
   
   on a 64 bit machine, it would be a uint64.
  
   
   
  
   I think everyone is missing the point. The advantage is not None.
  
   Chris Parker already gave the first good advantage. The second is this:
 Use
   NSInteger/NSUInteger everywhere in your app. Recompile it for 64-bit and
 you
   instantly have a fully 64-bit version with very little work. That's a
 huge
   advantage.
  
 
  But the same effect could be had simply by using long and unsigned
  long.
 

  No, the same effect could not have been done, for one of the reasons you
 mention below.

Except that effect is basically only useful for Apple, not for third
parties, and I'm speaking from the perspective of a third party.
Preserving exact method signatures is great when you need binary
compatibility. Generally we don't need to preserve them, though.
Simply having a binary compatible method signature is enough;
everything works just fine on 32-bit if you declare long but the
caller thinks that it's int.

The one exception to this is passing pointer arguments around, where
the compiler will generate a warning. This is rare, though; Cocoa
doesn't have a lot of places which take NSInteger *. Otherwise, using
long and unsigned long is essentially equivalent to using NSInteger
and NSUInteger. Apple even lets us define those two types to only use
long.

  IMO it's dangerous to talk about a 64-bit conversion in this manner.

  I disagree. It eases transition for apps that use the NSInteger type.
 Please read our release notes on the subject:

  http://developer.apple.com/releasenotes/Cocoa/Foundation.html#64Bit

  and the documentation:


 http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/Introduction/chapter_1_section_1.html

I have read both, I simply don't agree with the recommendation to use
NSInteger everywhere.

  Much like any other architecture change, there are a lot of different
  effects and blindly using safe types is not guaranteed to make your
  app work after a recompile.

  Yes; there are many cases where blindly using NSInteger/NSUInteger can get
 you unexpected results. But, we document the typical pitfalls, and they are
 easy to avoid. Certain apps (like TextEdit) can simply be recompiled.

Aside from a couple of places where it uses deprecated APIs, the 10.4
version of TextEdit can *also* simply be recompiled. I didn't test it
thoroughly but it appeared to work just fine when compiled as x86_64.
(There is one bug in the scripting system due to the change, revealed
by a warning. There may be others.)

  Likewise an application which uses
  non-NSInteger types may be written to Just Work when recompiled as
  64-bit.

  That is true too. You can easily recompile an app that uses int/float and
 still having it do most of its computations with 32-bit values, or use
 appropriate types where applicable. But that isn't a full 64-bit app unless
 you convert all uses of int to a larger type. You wouldn't write this on
 32-bit:

  for (short i = 0; i  ..; i++)

  And similarly, you shouldn't write this on 64-bit:

  for (int i = 0; i  ..; i++)

I find this whole line of reasoning a bit difficult to follow. The
essence of 32/64 bitness in the context we're discussing is pointer
size, not integer size. Indeed, half of Apple's supported 64-bit
architectures also support native 64-bit integer computation when in
32-bit mode. I would think that being a full 64-bit app would be
related to being able to deal with data that goes beyond the limit of
the 32-bit address space, not the sizes of the integers you use in
loops. And while the two concepts are related, they are only loosely
so. There are plenty of cases where using a 32-bit quantity in 64-bit
land will always be sufficient, and where using a 64-bit quantity in
32-bit land is always necessary.

I also think it's dangerous to talk about these types as though they
solve everything when they don't, even if they do help.

  If you are using any Cocoa API's you should be using NSInteger/NSUInteger,
 and not doing so would require much more work.

What primitive types you use ought to be unrelated to what APIs you
use. After all, the need to be 64-bit clean exists whether you use
Cocoa or not.

  The question was what advantage is there for using NSInteger/NSUInteger.
 The answer is 64-bit transition of your Cocoa apps.

It's certainly helpful, it's just neither necessary nor sufficient.

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


Re: mouseDown on NSScrollView

2008-04-09 Thread Michael Vannorsdel
The NSScrollers are getting the mouseDown events.  The NSScrollView is  
actually a collection of other more basic views.



On Apr 9, 2008, at 1:42 PM, Lorenzo wrote:


I have subsclassed a NSScrollView and overrided the mouseDown: method.
Then I create the MYScrollView programmatically and add it to the  
window's

contentView. I can quite see it but when I click on it, the method
mouseDown: gets never invoked. What do I miss?

___

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: mouseDown on NSScrollView

2008-04-09 Thread Michael Vannorsdel
Forgot to mention you could use some of the notifications of the  
clipview to detect scrolling if that's what you're looking for.



On Apr 9, 2008, at 1:42 PM, Lorenzo wrote:


 have subsclassed a NSScrollView and overrided the mouseDown: method.
Then I create the MYScrollView programmatically and add it to the  
window's

contentView. I can quite see it but when I click on it, the method
mouseDown: gets never invoked. What do I miss?


___

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: what is the proper place to store application settings

2008-04-09 Thread I. Savant
On Wed, Apr 9, 2008 at 3:44 PM, Jeff LaMarche [EMAIL PROTECTED] wrote:
 Actually, I agree... if this is a configuration parameter that he wants the
 user to be able to set. Since he was talking about using preprocessor
 directives, I made the assumption that this was not supposed to be
 user-configurable for some reason. In hindsight, that was probably a stupid
 assumption.

  I don't think it's a stupid assumption on your part at all. Quite a
reasonable one, actually.

  I *do* think it's a design flaw, however, to make this thing that
could easily change thereby breaking the application dependent on a
software update when it can *very easily* be made a user-configurable
item. You could even hide the UI if you wanted to, or have a canned
support response containing the command line defaults write ...
'fix' if the URL changes. That way, the users can fix for themselves
while you compile and distribute (and notify of) the  update.

--
I.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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Tips to deploy applications to multiple Mac OS X versions

2008-04-09 Thread PGM


- Does the Objective-C 2.0 fast enumeration make sense to be used? I  
mean, if I don't use it, will my application perform worse on Leopard?


Unless you are doing a huge number of enumerations, the difference is  
speed will not be worth the extra coding hassle. Better check the  
difference using the performance tools, to make sure you are not  
making your code much more complex for a few microseconds of speed gain.


Cheers, Patrick
___

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: what is the proper place to store application settings

2008-04-09 Thread Laimonas Simutis
On Wed, Apr 9, 2008 at 2:57 PM, I. Savant [EMAIL PROTECTED] wrote:
 On Wed, Apr 9, 2008 at 3:44 PM, Jeff LaMarche [EMAIL PROTECTED] wrote:
   Actually, I agree... if this is a configuration parameter that he wants the
   user to be able to set. Since he was talking about using preprocessor
   directives, I made the assumption that this was not supposed to be
   user-configurable for some reason. In hindsight, that was probably a stupid
   assumption.

   I don't think it's a stupid assumption on your part at all. Quite a
  reasonable one, actually.

No, not a bad assumption at all. I was pretty much thinking the same
thing, I did not want it to be user configurable. But in my case there
is really no good reason to make it that way as I.S. pointed out
already.
___

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: More NSUndoManager woes

2008-04-09 Thread Alastair Houghton

On 9 Apr 2008, at 14:24, Graham Cox wrote:

I'm not sure I fully understand it either - undo issues often make  
my head spin...


Yeah, undo, while NSUndoManager and Objective-C theoretically make it  
easy, is still tricky to get right sometimes.


However you might be right about the ref counting bug, so I'll try  
and re-examine it from that angle.


It might be worth trying to come up with a small test program that can  
reproduce the issue.


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


Re: [OFF] unicode characters

2008-04-09 Thread Ricky Sharp


On Apr 9, 2008, at 1:25 PM, Douglas Davidson wrote:



On Apr 9, 2008, at 11:14 AM, Alexander Cohen wrote:

Sorry for the off-topic post but this is the best place to get info  
( lots of smart people ).


I have a string that is composed unicode characters. I want to be  
able to transform that string into all ascii characters by  
transforming all non-ascii characters into their ascii equivalent.


ex:

ü = u
é = e

Anyone know of a way to do that or do i need a lookup table with  
all characters and their equivalents?


Take a look at CFStringTransform().  The details will depend on  
exactly what you want to do.



And of course, this process will only work on a subset of all the  
Latin-based languages.


Are you using this to build sort keys?  If so, you should probably  
just use the various compare APIs available.  Those would also ensure  
that the rules honor what the user has set up in their International  
prefs.


___
Ricky A. Sharp mailto:[EMAIL PROTECTED]
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 [EMAIL PROTECTED]


CGImage

2008-04-09 Thread Hugo Duncan
Hi,

I am trying to edit image metadata, and am getting link errors for the 
MakerCanon and DNG properties, such as,

 _kCGImagePropertyMakerCanonFirmware, referenced from:
  _kCGImagePropertyMakerCanonFirmware$non_lazy_ptr in myfile.o


The other properties are not causing any issues, so I imagine I am linking the 
correct files (this is my first cocoa project!).

Anyone able to suggest a fix?

Regards,
Hugo

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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 [EMAIL PROTECTED]


mouseDown on NSScrollView

2008-04-09 Thread Lorenzo
I have subsclassed a NSScrollView and overrided the mouseDown: method.
Then I create the MYScrollView programmatically and add it to the window's
contentView. I can quite see it but when I click on it, the method
mouseDown: gets never invoked. What do I miss?

Best Regards
-- 
Lorenzo
email: [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]


64-bit apps [was Re: NSUInteger question]

2008-04-09 Thread Ken Victor

At Wed, 09 Apr 2008 10:43:34 -0700, Corbin Dunn [EMAIL PROTECTED]:

The question was what advantage is there for using NSInteger/
NSUInteger. The answer is 64-bit transition of your Cocoa apps.

-corbin


this raises a question i've been meaning to ask for a while:

can anyone speculate as to whether or not the (near) future world is 
64 bit apps only (ie, 32 bit apps will no longer work -- similar to 
the way classic apps no longer work.)?


currently, i believe there are small performance penalties for 64-bit 
apps as we still are in a primarily 32 bit world. i imagine this will 
shift over the next few years, but will 32 bit apps no longer work?


thanx for any thoughts/guidance (as to whether or not it is worth the 
effort to become a 64 bit app),


ken
___

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

2008-04-09 Thread Christopher Nebel

On Apr 9, 2008, at 9:30 AM, Corbin Dunn wrote:


On Apr 8, 2008, at 5:30 PM, Timothy Reaves wrote:

What advantage does NSUinteger have over uint32?   I realize that  
on a 64 bit machine, it would be a uint64.


I think everyone is missing the point. The advantage is not None.


I didn't mean to say that NS[U]Integer has no point, but rather that  
it doesn't make sense to say that it has an advantage (or not) over  
uint32_t, because they mean different things.  If what you want is a  
machine-sized integer, then NSInteger has some very clear advantages  
over the alternative (lots of ifdefs).  However, if what you want is  
specifically a 32-bit integer, then NSInteger would just be wrong.   
I'd venture that most uses are in the former camp, not the latter, but  
it deserves at least a little thought.


As for the question of NSInteger versus long, I've had to work on  
enough different architectures that I consider there to be an implicit  
advantage in a typedef (NSInteger) over a bare long, but that's me.



--Chris Nebel
___

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]


Hide application from dock

2008-04-09 Thread Jere Gmail
I know I can hide my app from dock simply changing the value
NSUIElement in the Info.plist
But I want to do it from inside the application. Is there an easy way
to modify this file?

-- 
http://zon7blog.wordpress.com/
And again we fall.
___

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: 64-bit apps [was Re: NSUInteger question]

2008-04-09 Thread Nick Zitzmann


On Apr 9, 2008, at 2:51 PM, Ken Victor wrote:
can anyone speculate as to whether or not the (near) future world is  
64 bit apps only (ie, 32 bit apps will no longer work -- similar to  
the way classic apps no longer work.)?


It'll be a while. Right now it's a bad idea, since a lot of people are  
still using Power Mac G4s and 2006-era Intel Macs. Also, there are  
applications that benefit from 64-bit addressing, but they're kind of  
rare right now. Heck, on that other operating system, many people are  
still using Win16 apps...


currently, i believe there are small performance penalties for 64- 
bit apps as we still are in a primarily 32 bit world. i imagine this  
will shift over the next few years, but will 32 bit apps no longer  
work?


The performance penalties are on PPC64 only. X86-64 doesn't have  
performance penalties, in fact, X86-64 apps will run faster because  
function arguments no longer have to be 4-byte aligned on the stack.  
They aren't even stored on the stack anymore, unless they're very  
large data structures.


thanx for any thoughts/guidance (as to whether or not it is worth  
the effort to become a 64 bit app),



As I see it, you probably should build for 64-bit if you can, since 64- 
bit apps are faster (on Intel Macs only) and are far more scalable.  
The only drawbacks are:


1. Because some of the types are twice as twice as large on 64-bit,  
such as long, size_t, NSInteger, CGFloat, all pointers, etc., all 64- 
bit apps will use somewhat more RAM than 32-bit apps.


2. Since there aren't a whole lot of 64-bit apps out there, when some  
users see them using more memory, they tend to think something's wrong  
with the app. This is especially true if GC is also turned on, as it  
is in 64-bit Xcode, and the VM requirement swells to 30+ GB. I don't  
remember why turning GC on does this.


3. The 32-bit frameworks are more than a decade old, and although they  
have some bugs, they are very stable from all the years of  
development. The same cannot be said of the 64-bit environment, which  
are still new  have had some interesting bugs. Most of them have been  
fixed in point releases.


4. Although a lot of legacy stuff got taken out of the frameworks,  
some older things that are still useful, such as the QuickTime  
Sequence Grabber, are either not available on 64-bit, or their  
replacements are not as good.


If you'd like, you can build for 64-bit now but by default make the  
app run as 32-bit. This is done with the LSArchitecturePriority key in  
Info.plist files.


Nick Zitzmann
http://www.chronosnet.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 [EMAIL PROTECTED]


RE: Hide application from dock

2008-04-09 Thread John Stiles
You cannot tell your app to hide from the dock once it has shown.
However, you can start hidden and become visible via the (IIRC)
TransformProcessType API.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Jere Gmail
Sent: Wednesday, April 09, 2008 2:11 PM
To: Cocoa Dev
Subject: Hide application from dock

I know I can hide my app from dock simply changing the value
NSUIElement in the Info.plist
But I want to do it from inside the application. Is there an easy way
to modify this file?

-- 
http://zon7blog.wordpress.com/
And again we fall.
___

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/jstiles%40blizzard.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: 64-bit apps [was Re: NSUInteger question]

2008-04-09 Thread Bill Bumgarner

On Apr 9, 2008, at 2:17 PM, Nick Zitzmann wrote:
2. Since there aren't a whole lot of 64-bit apps out there, when  
some users see them using more memory, they tend to think  
something's wrong with the app. This is especially true if GC is  
also turned on, as it is in 64-bit Xcode, and the VM requirement  
swells to 30+ GB. I don't remember why turning GC on does this.


The collector reserves a 32GB zone of addresses to serve up scanned  
allocations (the autozone).


It is only allocating addresses and not actually touching all of that  
memory.  Thus, it bumps the address space by 32GB, but does not  
actually use 32 GB of memory or VM.


b.bum

___

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: 64-bit apps [was Re: NSUInteger question]

2008-04-09 Thread Nick Zitzmann


On Apr 9, 2008, at 3:23 PM, Bill Bumgarner wrote:
The collector reserves a 32GB zone of addresses to serve up scanned  
allocations (the autozone).


It is only allocating addresses and not actually touching all of  
that memory.  Thus, it bumps the address space by 32GB, but does not  
actually use 32 GB of memory or VM.



Thanks. I wish this was documented somewhere, preferably in Activity  
Monitor's online help, because some people do notice the huge  
allocation and freak out... I should file a bug on that.


Nick Zitzmann
http://www.chronosnet.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 [EMAIL PROTECTED]


Re: Hide application from dock

2008-04-09 Thread Jere Gmail
I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.
btw, I know I have to restart the application in order to apply the changes :P

On Wed, Apr 9, 2008 at 11:25 PM, Randall Meadows [EMAIL PROTECTED] wrote:
 On Apr 9, 2008, at 3:10 PM, Jere Gmail wrote:

  I know I can hide my app from dock simply changing the value
  NSUIElement in the Info.plist
  But I want to do it from inside the application. Is there an easy way
  to modify this file?
 

  NSBundle -pathForResource... will get you the path to the file, which you
 can then open and modify.  You'll have to restart the app in order for that
 change to be seen by the system.




-- 
http://zon7blog.wordpress.com/
And again we fall.
___

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: Hide application from dock

2008-04-09 Thread Randall Meadows

[resending with my subscribed address--grrr]

On Apr 9, 2008, at 3:34 PM, Jere Gmail wrote:

I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.


NSMutableDictionary

Read it into a dictionary, change the appropriate key-value pair,  
write it back out.

___

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: 64-bit apps [was Re: NSUInteger question]

2008-04-09 Thread Keith Duncan
currently, i believe there are small performance penalties for 64- 
bit apps


'small' could be a bit of an understatement, when loading a 64 bit  
application into memory the OS has to load all the 64 bit libraries  
too. This propagates down the entire framework stack, if I recall  
correctly it goes something like Cocoa-ApplicationServices- 
CoreServices-libSystem. If your app is the only 64 bit one running  
then these frameworks aren't going to be shared in memory causing a  
much greater memory demand on the system, i.e. having both 32 bit and  
64 bit versions loaded. Are the 64 bit versions unloaded when the last  
64 bit app terminates?


That said I think it's still worth compiling as 64 bit, but making  
sure that you take the required precautions. These are detailed either  
in the docs or the WWDC materials. After all, isn't Apple's whole  
computer lineup fully 64 bit now?


Keith
___

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: Hide application from dock

2008-04-09 Thread Hamish Allan
On Wed, Apr 9, 2008 at 10:34 PM, Jere Gmail [EMAIL PROTECTED] wrote:

 I know taht with nsbundle I can obtain the path. But as it is a xml
  file, I didn't want to mess with it and I was guessing some class
  could handle it easily.

See http://www.google.com/search?q=plist+cocoabtnI=I'm%20Feeling%20Lucky

Hamish
___

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

2008-04-09 Thread Hugo Duncan
Scott,

On Wed, 09 Apr 2008 Scott Thompson wrote:
 If this constant follows the behavior of most constants of it's kind,
 you could work around the problem by adding:

 const CFStringRef kCGImagePropertyMakerCanonFirmware =
 CFSTR(kCGImagePropertyMakerCanonFirmware);

Thanks for the workaround.

Hugo


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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 [EMAIL PROTECTED]


Override AppleScrollBarVariant on NSScroller?

2008-04-09 Thread slasktrattenator
Hi,

I'm looking for a way to override the user's AppleScrollBarVariant
setting, and force the arrows on my custom NSScroller to be displayed
at both ends of the scroller. The documentation has no mentioning of
this. Does anyone know if this is possible?

Thanks.
F.
___

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]


Making IB set maximum height but not width?

2008-04-09 Thread Jack Repenning
Is there a way to get Interface Builder to set a maximum height on a  
window, but not limit the width?


I know some work-arounds, such as setting a max on both but making the  
max width huge, or enforcing it in the code, but is it doable as stated?



-==-
Jack Repenning
[EMAIL PROTECTED]
Project Owner
SCPlugin
http://scplugin.tigris.org
Subversion for the rest of OS X


___

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: Making IB set maximum height but not width?

2008-04-09 Thread Hamish Allan
On Wed, Apr 9, 2008 at 11:22 PM, Jack Repenning
[EMAIL PROTECTED] wrote:

 Is there a way to get Interface Builder to set a maximum height on a window,
 but not limit the width?

Just set the max width to 0.

Hamish
___

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]


Copying a JPEG image with CGImage changes file size

2008-04-09 Thread Hugo Duncan
Hi,

I am wanting to edit metadata in a JPEG, and am just testing
code (below) to read and write out an image without modification using CGImage 
to make sure I can do so without changing the image.  I am unable to obtain an
output file which is identical to the input file.  Any suggestions?  have tried 
setting kCGImageDestinationLossyCompressionQuality to 1.0.

Thanks,
Hugo

// Load the image
NSURL *absURL= [NSURL fileURLWithPath:@testImage.JPG];
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)absURL, 
NULL);
size_t numImages=CGImageSourceGetCount(source);

// Create an image destination writing to `url'
NSURL *absURL2= [NSURL fileURLWithPath:@testImageOutput.JPG];
 
  CGImageDestinationRef dest =
CGImageDestinationCreateWithURL((CFURLRef)absURL2,
(CFStringRef)@public.jpeg, numImages, nil);

size_t i=0;
for (i=0; inumImages; ++i)
{
CFMutableDictionaryRef mMetadata = 
(CFMutableDictionaryRef)CGImageSourceCopyPropertiesAtIndex(source, i, nil);
CGImageDestinationAddImageFromSource(dest, source, i, mMetadata);
}  

BOOL status = CGImageDestinationFinalize(dest);


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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 [EMAIL PROTECTED]


Re: Override AppleScrollBarVariant on NSScroller?

2008-04-09 Thread slasktrattenator
On a similar note, how can I find out what the current
AppleScrollBarVariant is? The docs don't cover this either :-/

On Thu, Apr 10, 2008 at 12:12 AM,  [EMAIL PROTECTED] wrote:
 Hi,

  I'm looking for a way to override the user's AppleScrollBarVariant
  setting, and force the arrows on my custom NSScroller to be displayed
  at both ends of the scroller. The documentation has no mentioning of
  this. Does anyone know if this is possible?

  Thanks.
  F.

___

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 to force NSTableView to stop editing a text cell?

2008-04-09 Thread Corbin Dunn


On Apr 9, 2008, at 5:51 AM, Graham Cox wrote:
How can I force a text cell in NSTableView to stop editing? On 10.4  
I could just tell the view's window to make the entire table the  
first responder and that did the trick, but on 10.5 this no longer  
works.


I'm trying to do this from within the textDidEndEditing:  
notification method so that I can suppress the table behaviour that  
goes to the next row and starts editing there - I just want the text  
to end editing on typing return and the table view to go back to its  
previous state - same row selected but no text being edited.




What you describe is now the default 10.5 behavior (which the majority  
of people want). You can do an AppKitVersion check and just call  
[super textDidEndEditing:] if you are on Leopard.


FWIW, -abortEditing basically just makes the window first responder  
(and does some other minor stuff in tableview). It should still work  
the same as 10.4.


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


Re: Override AppleScrollBarVariant on NSScroller?

2008-04-09 Thread Mike Abdullah
I believe one normally does this system-wide via the user defaults. I  
suspect that setting such a default for your app only may do the  
trick. Not that I've actually tested it - try it and see! :)


On 9 Apr 2008, at 23:12, [EMAIL PROTECTED] wrote:


Hi,

I'm looking for a way to override the user's AppleScrollBarVariant
setting, and force the arrows on my custom NSScroller to be displayed
at both ends of the scroller. The documentation has no mentioning of
this. Does anyone know if this is possible?

Thanks.
F.
___

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/cocoadev%40mikeabdullah.net

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: Hide application from dock

2008-04-09 Thread glenn andreas


On Apr 9, 2008, at 4:41 PM, Randall Meadows wrote:


[resending with my subscribed address--grrr]

On Apr 9, 2008, at 3:34 PM, Jere Gmail wrote:

I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.


NSMutableDictionary

Read it into a dictionary, change the appropriate key-value pair,  
write it back out.


You shouldn't design your application such that it requires being able  
to modify its own bundle in any way, shape or form.  In many cases you  
won't have write permission on it...



Glenn Andreas  [EMAIL PROTECTED]
 http://www.gandreas.com/ wicked fun!
quadrium2 | build, mutate, evolve, animate  | images, textures,  
fractals, art



___

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: Hide application from dock

2008-04-09 Thread John Stiles
Even if you could change it, once your app is running it, changing the 
plist won't have any effect until the next time the app is run. So it's 
probably a moot point.


glenn andreas wrote:


On Apr 9, 2008, at 4:41 PM, Randall Meadows wrote:


[resending with my subscribed address--grrr]

On Apr 9, 2008, at 3:34 PM, Jere Gmail wrote:

I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.


NSMutableDictionary

Read it into a dictionary, change the appropriate key-value pair, 
write it back out.


You shouldn't design your application such that it requires being able 
to modify its own bundle in any way, shape or form.  In many cases you 
won't have write permission on it...



Glenn Andreas  [EMAIL PROTECTED]
 http://www.gandreas.com/ wicked fun!
quadrium2 | build, mutate, evolve, animate  | images, textures, 
fractals, art



___

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/jstiles%40blizzard.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: Hide application from dock

2008-04-09 Thread Randall Meadows

On Apr 9, 2008, at 5:35 PM, John Stiles wrote:
Even if you could change it, once your app is running it, changing  
the plist won't have any effect until the next time the app is run.  
So it's probably a moot point.


Yes, I actually pointed that out in my first reply, which didn't make  
it to the list because Mail.app won't switch personalities  
appropriately, so I sent it from an illegal address.


Although, Glenn has a good point...code signing will surely break when  
doing that as well, right?  Does that operate on the entire bundle, or  
just the executable bits?



glenn andreas wrote:


On Apr 9, 2008, at 4:41 PM, Randall Meadows wrote:


[resending with my subscribed address--grrr]

On Apr 9, 2008, at 3:34 PM, Jere Gmail wrote:

I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.


NSMutableDictionary

Read it into a dictionary, change the appropriate key-value pair,  
write it back out.


You shouldn't design your application such that it requires being  
able to modify its own bundle in any way, shape or form.  In many  
cases you won't have write permission on 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 [EMAIL PROTECTED]


Re: Hide application from dock

2008-04-09 Thread Gregory Weston

Randall Meadows wrote:


I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.
btw, I know I have to restart the application in order to apply the  
changes :P


Do you also know that assuming you can write to a location referenced  
relative to the application will lead to frustrated users and support  
calls you can't actually do anything about? There are a fair number  
of situations where it simply will not work.

___

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]


IKImageView -zoomImageToFit causes flicker

2008-04-09 Thread Jamie Phelps
Hi, all. I'm working with ImageKit, and I've bumped into a problem.  
(See below for relevant source.) If I select an image that I've  
brought in from the filesystem, the -setIKImageViewImage: method  
causes a flickr. I have narrowed it down to the -zoomImageToFit: call.  
Without it, there is no flicker.


Moreover, if the image I select in the IKImageBrowserView has been  
taken with my MacBook's built-in iSight, the zoom does not cause the  
flicker.


Can anyone offer any thoughts about what might be causing the issue? I  
was thinking it might possibly be a caching issue, but I can't work  
out what the difference would be.


Thanks in advance for any help.

Jamie

- (void) imageBrowserSelectionDidChange:(IKImageBrowserView *) aBrowser{
if(selectedIndex == [[aBrowser selectionIndexes] firstIndex]){
NSLog(@First index has not changed);
return;
}
selectedIndex = [[aBrowser selectionIndexes] firstIndex];
if(selectedIndex != NSNotFound){
[self setIKImageViewImage:selectedIndex];
} else {
NSLog(@Selection is empty.);
[mImageView setImageWithURL:nil];
}
}

- (void)setIKImageViewImage:(int)index{
NSImage *mImg;
mImg = [[mImages objectAtIndex:selectedIndex] content];
CGImageSourceRef source;
source = CGImageSourceCreateWithData((CFDataRef)[mImg  
TIFFRepresentation], NULL);
CGImageRef newImage =  CGImageSourceCreateImageAtIndex(source, 0,  
NULL);

[mImageView setImage:newImage imageProperties:nil];
[mImageView zoomImageToFit:nil];
}
___

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: Hide application from dock

2008-04-09 Thread Randall Meadows

On Apr 9, 2008, at 5:52 PM, Gregory Weston wrote:

Randall Meadows wrote:


I know taht with nsbundle I can obtain the path. But as it is a xml
file, I didn't want to mess with it and I was guessing some class
could handle it easily.
btw, I know I have to restart the application in order to apply the  
changes :P


Do you also know that assuming you can write to a location  
referenced relative to the application will lead to frustrated users  
and support calls you can't actually do anything about? There are a  
fair number of situations where it simply will not work.


Just for the record, that attribution is incorrect--I did NOT write  
that.  I am not the one trying to do this, I'm just telling him how he  
can do what he shouldn't do. :)

___

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: Override AppleScrollBarVariant on NSScroller?

2008-04-09 Thread Michael Watson
I hope it isn't possible. I don't really want applications actively  
ignoring my scroll bar setting and enforcing its own. I prefer them at  
one end, together, at bottom. If suddenly one or two of my apps are  
different, it's going to drive me batty as I switch around between  
apps, and those weird apps are gonna take a quick trip to the trash.



--
m-s


On 09 Apr, 2008, at 18:12, [EMAIL PROTECTED] wrote:

Hi,

I'm looking for a way to override the user's AppleScrollBarVariant
setting, and force the arrows on my custom NSScroller to be displayed
at both ends of the scroller. The documentation has no mentioning of
this. Does anyone know if this is possible?

Thanks.
F.
___

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/mikey-san 
%40bungie.org


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]


How to replace image contents?

2008-04-09 Thread Samvel

Hi,

I have a class with image property:

@interface MyClass
{
...
NSImage *image;
}

...

@end

in -(void) init: this image object is set like:

-(void) init
{
...
image = [[NSImage alloc] initWithData: imageData];
...
}

somewhere else in another method image should be replaced with new  
data. Easiest way is to release and creation of new NSImage object like:


...
[image release];
image = [[NSImage alloc] initWithData: newImageData];
...

But these lines of code involves freeing memory and allocating new  
object although it seems to be faster if data would be replaced  
instead of recreating the whole object. Is it possible to do that way:  
just to replace image contents with newImageData without reallocating  
new object?


Thanks, Samvel.
___

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 to replace image contents?

2008-04-09 Thread Bill Bumgarner

On Apr 9, 2008, at 7:43 PM, Samvel wrote:
But these lines of code involves freeing memory and allocating new  
object although it seems to be faster if data would be replaced  
instead of recreating the whole object. Is it possible to do that  
way: just to replace image contents with newImageData without  
reallocating new object?


Not via the NSImage API.  You could use an NSBitmapImageRep instead.

However, have you run Shark or Instruments to determine if this is  
actually a performance issue?


More likely, most of your CPU cycles are being consumed by actually  
changing out the image data and very few cycles are consumed by the  
allocation of the wrapper object.


Before you bother with NSBitmapImageRep, I would highly recommend  
using the provided tools to figure out what needs to be optimized first.


b.bum

BTW:  NSBitmapImageRep has the honor of having the single longest  
method declaration of any class in Mac OS X.  Or, at least, I think it  
does.


- (id)initWithBitmapDataPlanes:(unsigned char **)planes pixelsWide: 
(int)width pixelsHigh:(int)height bitsPerSample:(int)bps  
samplesPerPixel:(int)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar  
colorSpaceName:(NSString *)colorSpaceName  bitmapFormat: 
(NSBitmapFormat)bitmapFormat bytesPerRow:(int)rBytes bitsPerPixel: 
(int)pBits;


(There might have been a method in EOF that was actually longer)

___

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 to replace image contents?

2008-04-09 Thread Samvel
It was a general thought. I am programming in Objective-C only for  
about month and was wondering if there is any faster way to replace  
image/string/etc. contents instead of reallocating object itself.


Samvel.

On Apr 9, 2008, at 9:58 PM, Bill Bumgarner wrote:


On Apr 9, 2008, at 7:43 PM, Samvel wrote:
But these lines of code involves freeing memory and allocating new  
object although it seems to be faster if data would be replaced  
instead of recreating the whole object. Is it possible to do that  
way: just to replace image contents with newImageData without  
reallocating new object?


Not via the NSImage API.  You could use an NSBitmapImageRep instead.

However, have you run Shark or Instruments to determine if this is  
actually a performance issue?


More likely, most of your CPU cycles are being consumed by actually  
changing out the image data and very few cycles are consumed by the  
allocation of the wrapper object.


Before you bother with NSBitmapImageRep, I would highly recommend  
using the provided tools to figure out what needs to be optimized  
first.


b.bum

BTW:  NSBitmapImageRep has the honor of having the single longest  
method declaration of any class in Mac OS X.  Or, at least, I think  
it does.


- (id)initWithBitmapDataPlanes:(unsigned char **)planes pixelsWide: 
(int)width pixelsHigh:(int)height bitsPerSample:(int)bps  
samplesPerPixel:(int)spp hasAlpha:(BOOL)alpha isPlanar: 
(BOOL)isPlanar colorSpaceName:(NSString *)colorSpaceName   
bitmapFormat:(NSBitmapFormat)bitmapFormat bytesPerRow:(int)rBytes  
bitsPerPixel:(int)pBits;


(There might have been a method in EOF that was actually longer)



___

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]


  1   2   >