Re: UTExportedTypeDeclarations vs CFBundleDocumentTypes

2009-01-12 Thread Kyle Sluder
On Sun, Jan 11, 2009 at 7:49 PM, Mitchell Livingston livings...@mac.com wrote:
 Thanks for the link. I removed CFBundleTypeExtensions, but now the file icon
 won't show up for any of that file type (for example, I associate the file
 to another app, the icon changes for that app; I then re-associate the file
 with my app but the icon doesn't change back. When I re-add
 CFBundleTypeExtensions it works as expected. Am I doing something wrong or
 is this a bug in the Finder?

Have you added the appropriate public.filename-extension array to the
UTTypeTagSpecification key in your UTI declaration?

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


iTunes-like tail truncation for attributed strings

2009-01-12 Thread Steve Cronin

Folks;

I have a source list type view.
I am using a tableView not an outlineView because it works for this  
data set.

I have an attributed string which has an image and a name.
This is the only column in this tableView.
This tableView is contained in a splitView which allows this 'nav' to  
be re-sized


A lot of words to describe something quite similar to iTunes.
As you reduce iTunes playlist column size toward its minimum, the  
playlists do a 'tail truncation' on any long text.


How do I achieve that?
What I am seeing regardless of many different settings, is that the  
text 'breaks' at the space between the image and wraps to a a second  
line.

I have Truncate Tail set in the Text Field Cell for the table column.

Can you achieve this with effect with IB and an attributed string or  
is some other code solution necessary?


Thanks for any help!
Steve
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSWindow With Only Close Button?

2009-01-12 Thread Kyle Sluder
On Sun, Jan 11, 2009 at 7:45 PM, Chunk 1978 chunk1...@gmail.com wrote:
 humm... would be interesting to know how it's possible... so you think
 it's programatically accomplished with carbon?  maybe it's a custom
 view placed over hiding the other buttons in carbon?

No, there's weirdness involved when you talk about Carbon and Cocoa
windows.  Suffice it to say that you aren't supposed to remove buttons
in Cocoa windows, just disable them.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: What is the equivalent of a C++ pure-virtual function in Objective-C?

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 03:29, Graham Cox a écrit :



On 12 Jan 2009, at 1:20 pm, Michael A. Crawford wrote:

I want to force derived classes to implement a given interface  
without provided a default implementation.  Does the concept exist  
in Objective-C (I'm almost sure it does)?  If so, what does the  
syntax look like?



The nearest thing to pure virtual methods is a formal protocol,  
declared using the @protocol directive.


file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_6.html

A class that conforms to the formal protocol is required to  
implement the methods of the protocol.


Just for the record. Mac OS 10.5 introduced two new keywords to define  
methods in a protocol:


@required
@optional.

A class that conforms to the formal protocol is required to  
implement the methods marked as required of the protocol.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How can i read the iTunes Library file?

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 05:27, Andrew Farmer a écrit :


On 11 Jan 09, at 13:43, Luca wrote:
I'd want to read the contents of the file iTunes stores in ~/Music/ 
iTunes/iTunes Library in my Cocoa Application.

How can i do?


You can't; the format isn't documented, and changes frequently. Use  
the XML version instead, or use Scripting Bridge to access iTunes.


On a related note, keep in mind that the user's iTunes library isn't  
guaranteed to be in ~/Music.


And even if it is in Music, the file name change from time to time  
(was iTunes Music Library in old iTunes version and may change again  
in futur version).




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSWindow With Only Close Button?

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 01:36, Kyle Sluder a écrit :

On Sun, Jan 11, 2009 at 7:18 PM, Chunk 1978 chunk1...@gmail.com  
wrote:
i noticed the window of the OS Install Assistant of Parallels 4.0  
only

has a close button in the top left corner of the window.  i didn't
know this was possible.  how is this accomplished?


I don't think you can do it in Cocoa; you certainly can't do it in IB.
Parallels is a Carbon app.




[[myWindow standardWindowButton: NSWindowZoomButton] setHidden:YES];
[[myWindow standardWindowButton: NSWindowMiniaturizeButton]  
setHidden:YES];___


Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Getting the mouse position in pixels in QC

2009-01-12 Thread Jonathan Selander

Hi,

I'm trying to make something that can get the mouse position in pixels  
in quartz composer using rendering destination dimensions and  
mouse. The idea is to dynamically be able to know if the mouse is  
over a specific image or not.


If i have the mouse at 1/4 of the screen, the opengl position or  
whatever it's called is -0.5, how can i use this to get the actual  
pixel position?


Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: What is the equivalent of a C++ pure-virtual function in Objective-C?

2009-01-12 Thread Graham Cox


On 12 Jan 2009, at 7:33 pm, Jean-Daniel Dupas wrote:

Just for the record. Mac OS 10.5 introduced two new keywords to  
define methods in a protocol:


@required
@optional.

A class that conforms to the formal protocol is required to  
implement the methods marked as required of the protocol.



Yes, but if you don't specify anything, @required is assumed.

--Graham
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Getting the mouse position in pixels in QC

2009-01-12 Thread Kyle Sluder
Are you sure you didn't want the quartz-composer-dev list?

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Implementing an Inspector similar to the one in IB.

2009-01-12 Thread Kyle Sluder
On Sun, Jan 11, 2009 at 3:20 AM, Brian Bruinewoud br...@darknova.com wrote:
 I would like to implement an inspector that has views that show/hide by
 clicking on their headings similar to the ones in the Interface Builder
 inspector.

Are you talking about the row of buttons at the top that changes the
contents of the panel (like the similar Inspector in iWork apps)?  If
so, you can use a tabless NSTabView and a NSSegmentedControl, though
it won't look quite the same (NSSegmentedControl highlights its
selection in gray, not blue, rdar://5918481).  Set a different tag for
each segment of the NSSegmentedControl, and wire up the action of the
control to a method on your window controller that switches the
selected tab in the NSTabView accordingly.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSComparisonResult, 'double wildcard'

2009-01-12 Thread Martijn van Exel

Hi all,

I'm looking at the TableSearch example to implement a similar view  
with a UISearchBar which essentally should act as a filter for the  
cells in the UITableView below it.
The TableSearch example implements an NSComparisonResult that filters  
using a single wildcard (for want of a better term...): it filters by  
comparing the string entered in the search bar to the beginning of the  
strings in the array that fills the table view. What I want instead is  
to filter on any part of the string (using a 'double wildcard' much  
like the SQL 'LIKE' operator.


Can I implement this using a NSComparisonResult?

Thanks,

--
martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How can i read the iTunes Library file?

2009-01-12 Thread Mike Abdullah
As others have said, you need to read in the XML file. I suggest using  
our iMedia framework to do it for you:


http://code.google.com/p/imedia/

On 11 Jan 2009, at 21:43, Luca wrote:

I'd want to read the contents of the file iTunes stores in ~/Music/ 
iTunes/iTunes Library in my Cocoa Application.

How can i do?


Thanks,
Luca C.
___

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 cocoa...@mikeabdullah.net


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Need help on nsfontmanager.

2009-01-12 Thread rethish
Hi all,


I want to use multiple font traits .

I.e..,making the text both bold and italic (LIKE BOLDITALIC )

Is this possible?

Thank you

regards


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Need help on nsfontmanager.

2009-01-12 Thread I. Savant

On Jan 12, 2009, at 7:19 AM, rethish wrote:

I want to use multiple font traits . I.e..,making the text both  
bold and italic (LIKE BOLDITALIC ) Is this possible?



  It's 2009 - yes, this is possible. Have you read the documentation?  
What specifically have you tried?



Font Handling
http://developer.apple.com/documentation/Cocoa/Conceptual/FontHandling/FontHandling.html

NSFontManager Class Reference
http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSFontManager_Class/Reference/Reference.html


--
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 arch...@mail-archive.com


Re: UTExportedTypeDeclarations vs CFBundleDocumentTypes

2009-01-12 Thread Mitchell Livingston
Yup.
 
On Monday, January 12, 2009, at 03:16AM, Kyle Sluder kyle.slu...@gmail.com 
wrote:
On Sun, Jan 11, 2009 at 7:49 PM, Mitchell Livingston livings...@mac.com 
wrote:
 Thanks for the link. I removed CFBundleTypeExtensions, but now the file icon
 won't show up for any of that file type (for example, I associate the file
 to another app, the icon changes for that app; I then re-associate the file
 with my app but the icon doesn't change back. When I re-add
 CFBundleTypeExtensions it works as expected. Am I doing something wrong or
 is this a bug in the Finder?

Have you added the appropriate public.filename-extension array to the
UTTypeTagSpecification key in your UTI declaration?

--Kyle Sluder


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Ricky Sharp
Do not do this. Users will be very frustrated when they cannot  
interact with that button.


Why do you think you need this?

Sent from my iPhone

On Jan 12, 2009, at 5:55 AM, Donnie Lee lpr...@gmail.com wrote:


Hi!

I'd like to create a disabled button that looks like enabled. If I
just set enabled to no, I got grayed button. Instead I do
[[theButton cell] setHighlightsBy:NSNoCellMask]; and it looks like
disabled but continues to receive events. Is there a way to make a
disabled button that looks like enabled? Thanks in advance!

Donnie.
___

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/rsharp%40mac.com

This email sent to rsh...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Dynamically register document types

2009-01-12 Thread Georg Seifert

hello,

I have a program that uses plugins for supporting a wide range of  
documents.


Is there a way to tell Launch Services to include new file types if I  
install a new plugin?


I only found a discussion on cocoadev (http://www.cocoadev.com/index.pl?DynamiclyRegisteringDocumentTypes 
) where it says I have to update the info.plist. Is there any other way?


Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: iTunes-like tail truncation for attributed strings

2009-01-12 Thread Buddy Kurz

I found these in my email archive...


NSString *stringToDraw; // the string to draw
NSMutableDictionary *attrs = [NSMutableDictionary  
dictionaryWithCapacity:2];
NSMutableParagraphStyle *ps = [[[NSMutableParagraphStyle alloc]  
init] autorelease];

[ps setLineBreakMode:NSLineBreakByTruncatingTail];
[attrs setObject:ps forKey:NSParagraphStyleAttributeName];
[stringToDraw drawInRect:rect withAttributes:attrs];



The Cocoa Text System now allows the last visible line to have an  
ellipsis character appended if the entire content cannot fit into  
the specified bounding box. The behavior can be controlled with - 
truncatesLastVisibleLine for text cells. The -lineBreakMode must be  
either NSLineBreakByWordWrapping or NSLineBreakByCharWrapping for  
this option to take effect.. Also, the  
NSStringDrawingTruncatesLastVisibleLine flag can be specified to  
NSStringDrawing APIs that take NSStringDrawingOptions. The  
NSStringDrawingUsesLineFragmentOrigin flag must also be specified  
for the truncation flag to take effect.


Maybe this will point you in the right direction

bk



On Jan 12, 2009, at 12:19 AM, Steve Cronin wrote:


Folks;

I have a source list type view.
I am using a tableView not an outlineView because it works for this  
data set.

I have an attributed string which has an image and a name.
This is the only column in this tableView.
This tableView is contained in a splitView which allows this 'nav'  
to be re-sized


A lot of words to describe something quite similar to iTunes.
As you reduce iTunes playlist column size toward its minimum, the  
playlists do a 'tail truncation' on any long text.


How do I achieve that?
What I am seeing regardless of many different settings, is that the  
text 'breaks' at the space between the image and wraps to a a second  
line.

I have Truncate Tail set in the Text Field Cell for the table column.

Can you achieve this with effect with IB and an attributed string or  
is some other code solution necessary?


Thanks for any help!
Steve
___

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/buddykurz%40mac.com

This email sent to buddyk...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Help on player application

2009-01-12 Thread Arnab Ganguly
Hi All,
How do I handle the playlist files (pls file)? The application developed by
me is through QT ToolKit, hence it able to stream pls files with mp3 formats
from shoutcast.com.

Now I have the codecs for aacplus.How do I integrate this codec with the
above.As this doesn't support playing pls files ?Any help or pointers would
be very much appreciated.
Thanks in advance
-A
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: iTunes-like tail truncation for attributed strings

2009-01-12 Thread Steve Cronin

BK;

Thanks!!  Bingo!
The key for me:
...The behavior can be controlled with -truncatesLastVisibleLine for  
text cells...   This is a checkbox in IB, at the text cell inside the  
tableColumn.

This in conjunction with the LineBreaks: truncatesTail setting

I did NOT have to make any changes to the attributed string which  
simply specifies an baseline offset and the image  
(attrStringWithAttachement)


God Bless Cocoa!
Steve

On Jan 12, 2009, at 7:08 AM, Buddy Kurz wrote:


I found these in my email archive...


NSString *stringToDraw; // the string to draw
NSMutableDictionary *attrs = [NSMutableDictionary  
dictionaryWithCapacity:2];
NSMutableParagraphStyle *ps = [[[NSMutableParagraphStyle alloc]  
init] autorelease];

[ps setLineBreakMode:NSLineBreakByTruncatingTail];
[attrs setObject:ps forKey:NSParagraphStyleAttributeName];
[stringToDraw drawInRect:rect withAttributes:attrs];



The Cocoa Text System now allows the last visible line to have an  
ellipsis character appended if the entire content cannot fit into  
the specified bounding box. The behavior can be controlled with - 
truncatesLastVisibleLine for text cells. The -lineBreakMode must be  
either NSLineBreakByWordWrapping or NSLineBreakByCharWrapping for  
this option to take effect.. Also, the  
NSStringDrawingTruncatesLastVisibleLine flag can be specified to  
NSStringDrawing APIs that take NSStringDrawingOptions. The  
NSStringDrawingUsesLineFragmentOrigin flag must also be specified  
for the truncation flag to take effect.


Maybe this will point you in the right direction

bk



On Jan 12, 2009, at 12:19 AM, Steve Cronin wrote:


Folks;

I have a source list type view.
I am using a tableView not an outlineView because it works for this  
data set.

I have an attributed string which has an image and a name.
This is the only column in this tableView.
This tableView is contained in a splitView which allows this 'nav'  
to be re-sized


A lot of words to describe something quite similar to iTunes.
As you reduce iTunes playlist column size toward its minimum, the  
playlists do a 'tail truncation' on any long text.


How do I achieve that?
What I am seeing regardless of many different settings, is that the  
text 'breaks' at the space between the image and wraps to a a  
second line.

I have Truncate Tail set in the Text Field Cell for the table column.

Can you achieve this with effect with IB and an attributed string  
or is some other code solution necessary?


Thanks for any help!
Steve
___

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/buddykurz%40mac.com

This email sent to buddyk...@mac.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How can i read the iTunes Library file?

2009-01-12 Thread Luca

I'll have a look at this project, thanks.

Also thanks to Andrew and Jean Daniel.


Luca C.

On 12 jan 09, at 12:31, Mike Abdullah wrote:

As others have said, you need to read in the XML file. I suggest  
using our iMedia framework to do it for you:


http://code.google.com/p/imedia/

On 11 Jan 2009, at 21:43, Luca wrote:

I'd want to read the contents of the file iTunes stores in ~/Music/ 
iTunes/iTunes Library in my Cocoa Application.

How can i do?


Thanks,
Luca C.
___

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 cocoa...@mikeabdullah.net




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Mac Pro memory sizes

2009-01-12 Thread julius


On 12 Jan 2009, at 02:32, Michael Ash michael@gmail.com wrote:



In thinking about memory usage, where previously I would think of  
my program
in terms of 8 or 16 or 32 bit words should I now be thinking in  
terms of 64

bit words?
That is, should I think of my available internal memory space as  
effectively

being 500MB words?


No, this makes no sense. You have 2GB of memory. If you're working
with 64-bit words then it makes sense to think of your memory as being
roughly 256 million words (note: not 500) but that's not the same as
500MB words.

Yes, of course. Silly mistake.



Similarly, say that I had 100MB of 2 x 8-bit byte integers to save  
to disk,
should I now think that this will be saved as 100MB by 64 bit (i.e.  
8 x

8-bit byte) integers?
If it is 100MB by 64 bit integers then should I think of  
compressing the

data so as to reduce bandwidth requirements?


Just because your machine has a 64-bit processor doesn't mean you're
suddenly required to work with 64-bit quantities everywhere. You can
still work with 8, 16, or 32-bit quantities as you need.
Yes, but my understanding is that this will change when we go into a  
full 64 bit architecture and as a one man band I would prefer to write  
code that anticipates the change than to have to change everything  
later.

Also, the documentation
http://tinyurl.com/6ceoqz
leads me to believe that if I need an address space of more than 4GB  
then I should be using 64 bit computing.

Which one is
the most appropriate choice, I couldn't say, but you seem to have this
strange idea that your 8-bit integers will somehow magically take up
64 bits of storage just because you're running on a Core2
architecture. It's simply not the case.
I'm glad you've flagged this up because  one of the reasons for my  
asking the question was to increase my understanding of what I should  
and should not be thinking about in this regard.


So let me then ask: under the 64 bit architecture, will the standard c  
types like int, char etc still be available and not give me problems  
under garbage collection given I define them as strong?
Currently I'm defining most my variables as type NSInteger and  
CGFloat. Is that wrong?
Or should I be implementing my numbers as NSNumber? I thought the main  
purpose of NSNumber was as a wrapper to enable us to put numbers into  
NSArray etc. Would not using it as the main representation seriously  
affect computation speed ? What are other people doing?

If you have any good links or advice they'd be much appreciated.

Thanks

Julius

http://juliuspaintings.co.uk



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Security With Show Package Contents?

2009-01-12 Thread Chunk 1978
so i was a little put off after purchasing iWork '09, because i could
no longer access Show Package Contents of my pages files.  i
generally used this to swap out images of the same size, or to color
balance, etc.

anyway, i started thinking about security of applications based on
showing package contents.  as far as i know the only way for someone
to crack an application is to have access to the package contents
which lists the Unix Executable File in the Mac OS folder.  i guess
there's also the possibility to swap out frameworks (particularly
Aquatic Prime framework if the framework is installed instead of the
Aquatic Prime library)... since apps are really just folders with a
.app extension, wouldn't it be possible to disable Show Package
Contents, as with the new .pages files, so that it would make the app
more secure (if not impossible to crack)?  couldn't Apple implement
some sort of password protection or optional block on viewing package
contents with XCode so that apps are impossible to crack?

this post is totally just me thinking out loud.  i personally believe
that if someone is going to download a cracked version of an app then
either they wouldn't have bought a license anyway, or they don't have
the money... i'm not trying to make an app of mine more secure.  but
i'd like to hear your thoughts about this.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Joseph Crawford
AFAIK that would be impossible because someone would just find away  
around the protection.  There has to be a way to unprotect the app  
otherwise the file system would not be able to access the binary  
file.  If the file system has a way to access it, someone will figure  
that out and then they will be able to access it.


Trying to make an app un-crackable is not worth the time or effort, if  
it was feasible they would be doing it with OS's like OS X and Windows  
and even the big guys like Adobe.


Joseph Crawford

On Jan 12, 2009, at 10:18 AM, Chunk 1978 wrote:


so i was a little put off after purchasing iWork '09, because i could
no longer access Show Package Contents of my pages files.  i
generally used this to swap out images of the same size, or to color
balance, etc.

anyway, i started thinking about security of applications based on
showing package contents.  as far as i know the only way for someone
to crack an application is to have access to the package contents
which lists the Unix Executable File in the Mac OS folder.  i guess
there's also the possibility to swap out frameworks (particularly
Aquatic Prime framework if the framework is installed instead of the
Aquatic Prime library)... since apps are really just folders with a
.app extension, wouldn't it be possible to disable Show Package
Contents, as with the new .pages files, so that it would make the app
more secure (if not impossible to crack)?  couldn't Apple implement
some sort of password protection or optional block on viewing package
contents with XCode so that apps are impossible to crack?

this post is totally just me thinking out loud.  i personally believe
that if someone is going to download a cracked version of an app then
either they wouldn't have bought a license anyway, or they don't have
the money... i'm not trying to make an app of mine more secure.  but
i'd like to hear your thoughts about this.
___

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

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


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Devon Ferns
Have you checked if the new Pages file format is now binary instead of a 
package?  That would be my guess.  I don't see how you can stop anyone 
from listing a directory structure.


Devon

Chunk 1978 wrote:

so i was a little put off after purchasing iWork '09, because i could
no longer access Show Package Contents of my pages files.  i
generally used this to swap out images of the same size, or to color
balance, etc.

anyway, i started thinking about security of applications based on
showing package contents.  as far as i know the only way for someone
to crack an application is to have access to the package contents
which lists the Unix Executable File in the Mac OS folder.  i guess
there's also the possibility to swap out frameworks (particularly
Aquatic Prime framework if the framework is installed instead of the
Aquatic Prime library)... since apps are really just folders with a
.app extension, wouldn't it be possible to disable Show Package
Contents, as with the new .pages files, so that it would make the app
more secure (if not impossible to crack)?  couldn't Apple implement
some sort of password protection or optional block on viewing package
contents with XCode so that apps are impossible to crack?

this post is totally just me thinking out loud.  i personally believe
that if someone is going to download a cracked version of an app then
either they wouldn't have bought a license anyway, or they don't have
the money... i'm not trying to make an app of mine more secure.  but
i'd like to hear your thoughts about this.
___

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/dferns%40devonferns.com

This email sent to dfe...@devonferns.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Graham Lee
On 12/01/2009 15:18, Chunk 1978 chunk1...@gmail.com wrote:

 anyway, i started thinking about security of applications based on
 showing package contents.  as far as i know the only way for someone
 to crack an application is to have access to the package contents
 which lists the Unix Executable File in the Mac OS folder.

No, it's not.

 since apps are really just folders with a
 .app extension, wouldn't it be possible to disable Show Package
 Contents, as with the new .pages files, so that it would make the app
 more secure (if not impossible to crack)?

I don't see how that would make anything more secure, just as marking files
as 'hidden' doesn't. With some appropriate changes to the code signing
mechanism, interface and requirements they could make it hard - though not
impossible - for cracked apps to act as drop-in replacements for their
legitimate antecedents. But I'm pretty sure that while it's possible people
will do it, even if the pay-off were to disappear :-(

Graham.

--
Graham Lee
Senior Macintosh Software Engineer, Sophos Plc.
+44 1235 540266
http://www.sophos.com/


Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United 
Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Julien Jalon
New Pages format is the same but zipped.

On Mon, Jan 12, 2009 at 4:27 PM, Devon Ferns dfe...@devonferns.com wrote:

 Have you checked if the new Pages file format is now binary instead of a
 package?  That would be my guess.  I don't see how you can stop anyone from
 listing a directory structure.

 Devon

 Chunk 1978 wrote:

 so i was a little put off after purchasing iWork '09, because i could
 no longer access Show Package Contents of my pages files.  i
 generally used this to swap out images of the same size, or to color
 balance, etc.

 anyway, i started thinking about security of applications based on
 showing package contents.  as far as i know the only way for someone
 to crack an application is to have access to the package contents
 which lists the Unix Executable File in the Mac OS folder.  i guess
 there's also the possibility to swap out frameworks (particularly
 Aquatic Prime framework if the framework is installed instead of the
 Aquatic Prime library)... since apps are really just folders with a
 .app extension, wouldn't it be possible to disable Show Package
 Contents, as with the new .pages files, so that it would make the app
 more secure (if not impossible to crack)?  couldn't Apple implement
 some sort of password protection or optional block on viewing package
 contents with XCode so that apps are impossible to crack?

 this post is totally just me thinking out loud.  i personally believe
 that if someone is going to download a cracked version of an app then
 either they wouldn't have bought a license anyway, or they don't have
 the money... i'm not trying to make an app of mine more secure.  but
 i'd like to hear your thoughts about this.
 ___

 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/dferns%40devonferns.com

 This email sent to dfe...@devonferns.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/jjalon%40gmail.com

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

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Mac Pro memory sizes

2009-01-12 Thread Kenneth Bruno II

On Jan 12, 2009, at 9:50 AM, julius wrote:

So let me then ask: under the 64 bit architecture, will the standard  
c types like int, char etc still be available and not give me  
problems under garbage collection given I define them as strong?
Currently I'm defining most my variables as type NSInteger and  
CGFloat. Is that wrong?
Or should I be implementing my numbers as NSNumber? I thought the  
main purpose of NSNumber was as a wrapper to enable us to put  
numbers into NSArray etc. Would not using it as the main  
representation seriously affect computation speed ? What are other  
people doing?

If you have any good links or advice they'd be much appreciated.


From what I understand there won't much change for the smaller  
variable types.  Going 64 bit just means that the largest variables  
available will be larger and that you'll be able to address more  
memory at a time.  There will be some changes in size and alignment in  
some of the variable types but most of these changes will hardly be  
noticeable under most circumstances.


NSInteger and NSUInteger are designed so that they will best fit the  
environment which the code is compiled for.  If you use them then you  
generally don't have to worry if you are compiling for 32 bit or 64  
bit, these variables are defined with an appropriate size for the  
environment.  If you need to know what that size is then you can use  
the constants NSIntegerMin, NSIntegerMax, and NSUIntegerMax.


NSNumber is an object that holds values for you.  You use it when you  
can't use a plain variable, such as when you need to store a value in  
a container class that only holds objects, such as NSArray.  There is  
a small performance and memory hit for using NSNumber over a regular  
variable but if you use them in small amounts and don't allocate and  
deallocate them like mad then you shouldn't have any trouble.


You can learn more about 64 bit computing under Mac OS X here:
http://developer.apple.com/documentation/Darwin/Conceptual/64bitPorting/intro/chapter_1_section_1.html 



Here is the section on data type changes:
http://developer.apple.com/documentation/Darwin/Conceptual/64bitPorting/transition/chapter_3_section_3.html 



As you can see in that last link the variable types char, short, and  
int are staying the same size.  Only the variable types long, pointer,  
and size_t are changing size.  This isn't really a big deal but if you  
are writing code to compile for both 32 bit and 64 bit environments  
then you might want to do some sanity checks against the max size for  
the types that are going to change if you think you might run up  
against these limits in the 32 bit environment.


Lastly you can always use the exact-width integer types such as int8_t  
which are guaranteed to be at least 8 bits in size.  These (and many  
more) are defined in the C99 standard:

http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf

Honestly though, most of us won't have to worry about these details.   
I'd use NSInteger and NSUInteger unless you are dealing with a lot of  
very small integers that you need to pack in as little memory as  
possible.  If you need an object instead of a plain variable then use  
NSNumber or NSValue.


- 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 arch...@mail-archive.com


Re: create custom control same as multiple monitor control that manages monitors windows

2009-01-12 Thread Paul Bruneau

On Jan 12, 2009, at 12:19 AM, Gami Ravi wrote:


Hi All,

I want to create custom control that looks like a multiple monitor  
control that manages monitors on Mac. The custom control should  
allow the rectangle dragging and resizing same way we are moving  
monitor rectangle can be moved. If there are two rectangles then  
custom control should not allow overlapping of two rectangles?


What is the efficient way to design such control?

Any help would be appreciated.


The way I did a similar thing (and I think this is the standard way)  
was to create a custom NSView subclass to draw the control.


Keep track of the location and size of your monitor rectangles  
somewhere. Maybe you have an object for each monitor? Or maybe you  
just have instance variables in a controller class.


Override the -drawRect method of NSView to draw your rectangles, etc.

Override the -mouseDown method that NSView inherits from NSResponder  
to see if the user clicked on one of the rectangles.


Override the -mouseDragged method that NSView inherits from  
NSResponder to see where the user is dragging the rectangle. Only  
allow the user to drag it where it is possible to drag it (according  
to your rules)


Override the -mouseUp method to see where the user ended up leaving it.


This view programming guide should tell you everything you need to  
know about drawing and responding to user events in custom views:


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

Good luck!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 10:18 AM, Chunk 1978 chunk1...@gmail.com wrote:

 couldn't Apple implement
 some sort of password protection or optional block on viewing package
 contents with XCode so that apps are impossible to crack?

  Impossible to crack? I totally agree - they should also make it
impossible for apps to crash, too! :-)  Seriously, that's an
impossibly tall order. There's just no way to make something
impossible to crack (*or* crash for that matter, though you'll have a
better chance at this than the cracking thing).

  The fact is, Apple ALREADY put a highly-effective* system into
place: Code signing.

http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Introduction/chapter_1_section_1.html

  Caveat: This is supported only on 10.5 and above and is ignored on
older systems (per the above-referenced page). To make good use of it,
your app would need to simply *not work* on 10.4 and below. Not an
issue for new products that would support only 10.5 or above, but
worth pointing out nonetheless.

* - highly-effective != impossible to crack

--
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 arch...@mail-archive.com


Re: create custom control same as multiple monitor control that manages monitors windows

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 10:48 AM, Paul Bruneau
paul_brun...@special-lite.com wrote:

 The way I did a similar thing (and I think this is the standard way) was to
 create a custom NSView subclass to draw the control.

  Well ... the *standard* way is to use the control/cell system, but
the *easier* way is sometimes to simply use a custom NSView subclass
as you said. :-)

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

  NSControl gives you a lot of freebies that you'd have to implement
yourself (especially support for things such as accessibility
features, etc.) but at the cost of having to get your hands dirtier
with creating a custom cell. It's a bit more involved but usually more
appropriate if it's an interactive UI widget (ie, a control and not
simply a view).

--
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 arch...@mail-archive.com


Re: Security With Show Package Contents?

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 10:49 AM, I. Savant idiotsavant2...@gmail.com wrote:

  The fact is, Apple ALREADY put a highly-effective* system into
 place: Code signing.

  A retraction: From the documentation (quoted below), the user can
apparently run modified code anyway ...

  It is not a digital rights management (DRM) or copy protection
technology. Although the system could determine that a copy of your
program had not been properly signed by you, or that its copy
protection had been hacked, thus making the signature invalid, there
is nothing to prevent the user from running the program anyway.

  I have nothing that needs any real copy protection, so I have not
used this technology. This is one aspect of it that I had not
realized. :-( My apologies for the noise.

  My earlier statement about impossible to crack is 100% accurate,
however. :-)

--
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 arch...@mail-archive.com


Re: Mac Pro memory sizes

2009-01-12 Thread Clark Cox
On Mon, Jan 12, 2009 at 6:50 AM, julius jul...@juliuspaintings.co.uk wrote:

 On 12 Jan 2009, at 02:32, Michael Ash michael@gmail.com wrote:


 In thinking about memory usage, where previously I would think of my
 program
 in terms of 8 or 16 or 32 bit words should I now be thinking in terms of
 64
 bit words?
 That is, should I think of my available internal memory space as
 effectively
 being 500MB words?

 No, this makes no sense. You have 2GB of memory. If you're working
 with 64-bit words then it makes sense to think of your memory as being
 roughly 256 million words (note: not 500) but that's not the same as
 500MB words.

 Yes, of course. Silly mistake.


 Similarly, say that I had 100MB of 2 x 8-bit byte integers to save to
 disk,
 should I now think that this will be saved as 100MB by 64 bit (i.e. 8 x
 8-bit byte) integers?
 If it is 100MB by 64 bit integers then should I think of compressing the
 data so as to reduce bandwidth requirements?

 Just because your machine has a 64-bit processor doesn't mean you're
 suddenly required to work with 64-bit quantities everywhere. You can
 still work with 8, 16, or 32-bit quantities as you need.

 Yes, but my understanding is that this will change when we go into a full 64
 bit architecture

Not true.

 and as a one man band I would prefer to write code that
 anticipates the change than to have to change everything later.
 Also, the documentation
 http://tinyurl.com/6ceoqz
 leads me to believe that if I need an address space of more than 4GB then I
 should be using 64 bit computing.

True.


 Which one is
 the most appropriate choice, I couldn't say, but you seem to have this
 strange idea that your 8-bit integers will somehow magically take up
 64 bits of storage just because you're running on a Core2
 architecture. It's simply not the case.

 I'm glad you've flagged this up because  one of the reasons for my asking
 the question was to increase my understanding of what I should and should
 not be thinking about in this regard.

 So let me then ask: under the 64 bit architecture, will the standard c types
 like int, char etc still be available

Of course they will. Removing these types would render a C compiler useless.

 and not give me problems under garbage
 collection given I define them as strong?

Garbage collection has nothing to do with integers, only pointers.
There is no reason to define an int or char as strong.

 Currently I'm defining most my variables as type NSInteger and CGFloat. Is
 that wrong?

No, it isn't wrong, but it my be wasteful. My recommendation is to use
NSInteger/NSUInteger and CGFloat for parameters, and local variables.
However for things in structures or arrays, think carefully about
whether or not you actually *need* a 64-bit type, otherwise, you could
be wasting space.

 Or should I be implementing my numbers as NSNumber? I thought the main
 purpose of NSNumber was as a wrapper to enable us to put numbers into
 NSArray etc. Would not using it as the main representation seriously affect
 computation speed ? What are other people doing?
 If you have any good links or advice they'd be much appreciated.


-- 
Clark S. Cox III
clarkc...@gmail.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


debugging hard-to-locate error in NSApplication delegate

2009-01-12 Thread Greg Beaver
Hi,

Does anyone have working code that shows an application delegate in a
core data document-based app?  I'm trying to intercept
applicationShouldOpenUntitledFile: in order to open the last-saved
document.  I have code that works, but it causes this error:

*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil

some time between the setting of the delegate, which I did by inserting
this object into the nib and setting the delegate programmatically. 
linking from IB did not properly set the delegate (init and
applicationDidFinishLaunching: were called, but
applicationShouldOpenUntitledFile: was never called):

@implementation GreenwoodAppDelegate

- (void) init
{
[super init];
applicationHasStarted = NO;
if (![[NSApplication sharedApplication] delegate]) {
[[NSApplication sharedApplication] setDelegate:self];
}
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
applicationHasStarted = YES;
}

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
// On startup, when asked to open an untitled file, open the last opened
// file instead
if (!applicationHasStarted)
{
// Get the recent documents
NSDocumentController *controller =
[NSDocumentController sharedDocumentController];
NSArray *documents = [controller recentDocumentURLs];
   
// If there is a recent document, try to open it.
if ([documents count]  0)
{
NSError *error = nil;
[controller
 openDocumentWithContentsOfURL:[documents objectAtIndex:0]
 display:YES error:error];
   
// If there was no error, then prevent untitled from appearing.
if (error == nil)
{
return NO;
}
}
}
   
return YES;
}
@end

I borrowed the code in applicationShouldOpenUntitledFile: from a helpful
blog entry, can't remember where.

Thanks,
Greg
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: create custom control same as multiple monitor control that manages monitors windows

2009-01-12 Thread Paul Bruneau

On Jan 12, 2009, at 10:54 AM, I. Savant wrote:


On Mon, Jan 12, 2009 at 10:48 AM, Paul Bruneau
paul_brun...@special-lite.com wrote:

The way I did a similar thing (and I think this is the standard  
way) was to

create a custom NSView subclass to draw the control.


 Well ... the *standard* way is to use the control/cell system, but
the *easier* way is sometimes to simply use a custom NSView subclass
as you said. :-)

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

 NSControl gives you a lot of freebies that you'd have to implement
yourself (especially support for things such as accessibility
features, etc.) but at the cost of having to get your hands dirtier
with creating a custom cell. It's a bit more involved but usually more
appropriate if it's an interactive UI widget (ie, a control and not
simply a view).


You know, it's funny, when I first started my first Cocoa project as a  
total Cocoa newb I wanted to use controls/cells for my rectangles but  
I was strongly advised against it by very highly regarded Cocoa gurus.


Maybe it's because my project could have hundreds of rectangles in a  
single view and the gurus were concerned about all the overhead?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: [SOLVED] NSComparisonResult, 'double wildcard'

2009-01-12 Thread Martijn van Exel
Again, I solved it myself. A little embarassing. But hey, I'm just  
starting..
If anyone else might wonder how I got it right: I used the  
RangeOfString method of NSString to get a range and then add the  
object to the filtered objects array if the range's length is greater  
than zero:

for (cellTitle in speciesArray) {
if([cellTitle length]  [searchText length]) continue;
			NSRange range = [cellTitle rangeOfString:searchText  
options:NSCaseInsensitiveSearch range:NSMakeRange(0, [cellTitle  
length])];

if (range.length  0) [soortenFiltered 
addObject:cellTitle];
}

The first line is to prevent NSRangeExceptions when a very short  
string enters the loop as comparison base.


Thanks,
Martijn

--
martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/

Op 12 jan 2009, om 12:25 heeft Martijn van Exel het volgende geschreven:


Hi all,

I'm looking at the TableSearch example to implement a similar view  
with a UISearchBar which essentally should act as a filter for the  
cells in the UITableView below it.
The TableSearch example implements an NSComparisonResult that  
filters using a single wildcard (for want of a better term...): it  
filters by comparing the string entered in the search bar to the  
beginning of the strings in the array that fills the table view.  
What I want instead is to filter on any part of the string (using a  
'double wildcard' much like the SQL 'LIKE' operator.


Can I implement this using a NSComparisonResult?

Thanks,

--
martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Mac Pro memory sizes

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 9:50 AM, julius jul...@juliuspaintings.co.uk wrote:
 Yes, but my understanding is that this will change when we go into a full 64
 bit architecture and as a one man band I would prefer to write code that
 anticipates the change than to have to change everything later.

Well, that's wrong.

 Also, the documentation
 http://tinyurl.com/6ceoqz
 leads me to believe that if I need an address space of more than 4GB then I
 should be using 64 bit computing.

It's true, but 64 bit computing does not mean what you think it means.

 So let me then ask: under the 64 bit architecture, will the standard c types
 like int, char etc still be available and not give me problems under garbage
 collection given I define them as strong?

Yes, they are all identical to what they were before, with the
exception of 'long', which becomes a 64-bit quantity. I don't know
what your GC question is about, as GC only affects pointers.

Let me briefly explain what 64-bit is all about, because this seems
to be the major point of confusion here.

In a 32-bit processor, pointers are 32 bits long. Since 2^32 = 4
billion and change, this means that you can address about 4GB of
memory. Also, usually but not always, on a 32-bit processor the
largest native integer quantity is 32 bits long. Usually there is
software support for 64-bit integers but it suddenly becomes
significantly slower because the CPU can only deal with 32 bits at a
time.

In a 64-bit processor, pointers are 64 bits long. Since 2^64 = really
huge, that means you can address a really huge amount of memory (it's
equal to 4 billion and change squared). You also get native support
for 64-bit integers.

That's it! Pointer size and native 64-bit integers are the only
difference between the two! Your chars don't suddenly expand from 8
bits to 64 bits. Your floats don't suddenly expand from 32 bits to 64
bits. (On Mac OS X your longs do suddenly expand from 32 bits to 64
bits, but int still gives you a 32-bit integer.) The only difference
is the size of pointers and, sometimes, the ability to do native math
on 64-bit integers.

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 arch...@mail-archive.com


Re: debugging hard-to-locate error in NSApplication delegate

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 11:11 AM, Greg Beaver g...@chiaraquartet.net wrote:
 Hi,

 Does anyone have working code that shows an application delegate in a
 core data document-based app?  I'm trying to intercept
 applicationShouldOpenUntitledFile: in order to open the last-saved
 document.  I have code that works, but it causes this error:

 *** -[NSCFArray insertObject:atIndex:]: attempt to insert nil

First thing you need to do is find out where this error is coming
from. Without that information, the problem is far too difficult. See
Breaking on Exceptions on this page:

http://www.cocoadev.com/index.pl?DebuggingTechniques

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 arch...@mail-archive.com


Re: create custom control same as multiple monitor control that manages monitors windows

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 11:17 AM, Paul Bruneau
paul_brun...@special-lite.com wrote:

 You know, it's funny, when I first started my first Cocoa project as a total
 Cocoa newb I wanted to use controls/cells for my rectangles but I was
 strongly advised against it by very highly regarded Cocoa gurus.

  :-) I can see the argument for that in certain circumstances.

 Maybe it's because my project could have hundreds of rectangles in a single
 view and the gurus were concerned about all the overhead?

  ... this being one of them. It's probably easiest to do it with a
custom view because, to do it with cells, you have to build a more
complicated control like NSTableView. Its data cell is reused (to
avoid creating potentially astronomical numbers of cells just for
drawing).

  It really would depend on the situation and the comfort level
involved. My point, however, was that the standard way would be to
use the control/cell mechanism. Perhaps the Cocoa guru in question was
generalizing. :-)

--
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 arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Luca

I agree with Ricky. Why do you need this?
By the way, think the better way is to subclass the NSButton,  
overriding the -mouseDown method. Do not call -[super mouseDown:], and  
it's done - your button will not be drawed.


-- Luca C.

On 12 Jan 09, at 13:46, Ricky Sharp wrote:

Do not do this. Users will be very frustrated when they cannot  
interact with that button.


Why do you think you need this?

Sent from my iPhone

On Jan 12, 2009, at 5:55 AM, Donnie Lee lpr...@gmail.com wrote:


Hi!

I'd like to create a disabled button that looks like enabled. If I
just set enabled to no, I got grayed button. Instead I do
[[theButton cell] setHighlightsBy:NSNoCellMask]; and it looks like
disabled but continues to receive events. Is there a way to make a
disabled button that looks like enabled? Thanks in advance!

Donnie.
___

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/rsharp%40mac.com

This email sent to rsh...@mac.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/luca.pazzerello%40gmail.com

This email sent to luca.pazzere...@gmail.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 17:00, I. Savant a écrit :

On Mon, Jan 12, 2009 at 10:49 AM, I. Savant  
idiotsavant2...@gmail.com wrote:



The fact is, Apple ALREADY put a highly-effective* system into
place: Code signing.


 A retraction: From the documentation (quoted below), the user can
apparently run modified code anyway ...

 It is not a digital rights management (DRM) or copy protection
technology. Although the system could determine that a copy of your
program had not been properly signed by you, or that its copy
protection had been hacked, thus making the signature invalid, there
is nothing to prevent the user from running the program anyway.

 I have nothing that needs any real copy protection, so I have not
used this technology. This is one aspect of it that I had not
realized. :-( My apologies for the noise.

 My earlier statement about impossible to crack is 100% accurate,
however. :-)



The purpose of code sign is to prevent tempered code to be run  
inadvertently by an user, not to protect the binary itself.


An hacker can resign the modified app with its own certificate, so the  
modified app will be consider valid by the OS.


How, but you can embed your certificate into your app, and check if an  
hacker changed the signature.


Yes but the hacker will be able to replace your certificate with its  
own, or it can also modify the binary to skip the check.


An eternal mouse / cat game that's not worth the price.

Note that there is a lots of app impossible to crack. We call them  
freeware ;-)



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


@loader_path and @executable_path

2009-01-12 Thread Joseph Crawford
I do not know if this is a cocoa question or not, it is an error I get  
when I hit build  go


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


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


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


I also thought it was a project setting so i created the project again  
from scratch (it's small) but I still got the error, this led me to  
believe that it is an XCode setting so I reinstalled dev tools and the  
error still remains.


I did some checking in my build and my Frameworks are under Contents/ 
Frameworks/*


In my project directory I created a directory called /Frameworks/* and  
put the frameworks there.  I am not sure if this is the best way to  
use a framework by including it in my Bundle but I am not sure how  
else to do this.  I guess I could just put all external (non osx  
frameworks) in a directory on my computer and link them.


I have to mention that these errors do not seem to stop the frameworks  
from working when i run the build.  Sparkle still does the updates  
etc, just a bit odd to have the errors at all.


Any suggestions / feedback would be appreciated.

Thanks,
Joseph Crawford
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


RE: debugging hard-to-locate error in NSApplication delegate

2009-01-12 Thread Jon C. Munson II
Thanks for posting that link on breaking on exceptions...I'd been looking for 
some way to do that.  I wish Xcode would simply stop on an offending line [in 
my code, not the library behind] instead of making me hunt it down...that's one 
thing I do like about programming using MS' tools...

Peace, Love, and Light,
 
/s/ Jon C. Munson II

-Original Message-
From: cocoa-dev-bounces+jmunson=his@lists.apple.com 
[mailto:cocoa-dev-bounces+jmunson=his@lists.apple.com] On Behalf Of Michael 
Ash
Sent: Monday, January 12, 2009 11:24 AM
To: Cocoa Developers
Subject: Re: debugging hard-to-locate error in NSApplication delegate

On Mon, Jan 12, 2009 at 11:11 AM, Greg Beaver g...@chiaraquartet.net wrote:
 Hi,

 Does anyone have working code that shows an application delegate in a
 core data document-based app?  I'm trying to intercept
 applicationShouldOpenUntitledFile: in order to open the last-saved
 document.  I have code that works, but it causes this error:

 *** -[NSCFArray insertObject:atIndex:]: attempt to insert nil

First thing you need to do is find out where this error is coming
from. Without that information, the problem is far too difficult. See
Breaking on Exceptions on this page:

http://www.cocoadev.com/index.pl?DebuggingTechniques

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/jmunson%40his.com

This email sent to jmun...@his.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Chunk 1978
 Note that there is a lots of app impossible to crack. We call them freeware
 ;-)

clever  :p
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to show small button-style images to NSOutlineView?

2009-01-12 Thread Corbin Dunn


On Jan 9, 2009, at 11:03 PM, Donnie Lee wrote:


Hi!

I created 10.5 Source View using NSOutlineView and want to know how to
show small button-style images in cells when you select or hover them
(like in Mail.app round arrow image when you select RSS entry and so
on)? A code sample would be appreciate.


Ok, I whipped one up that does that:

http://developer.apple.com/samplecode/PhotoSearch/

You'll have to flip on the source list style in IB for the outline  
view.


corbin


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Getting the network Machine Icon

2009-01-12 Thread Sean McBride
On 1/11/09 2:31 PM, Sandro Noel said:

I'm looking for a way to programatically get the machine icon from my
servers, just like finder does in the finder.

 *SNIP*.

Any suggestions on where to look??

NSImage.  I think it's NSImageNameComputer.

--

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


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 11:46 AM, Jean-Daniel Dupas
devli...@shadowlab.org wrote:

 The purpose of code sign is to prevent tempered code to be run inadvertently 
 by an user, not to protect the binary itself.

  Agreed - see my retraction that immediately follows the message you
responded to. I misunderstood what I read about the technology months
ago and conceptual error when I read in more detail.

  I do admit wondering how OS X prevented merely swapping one
signature for another, which is what prompted me to read the
documentation in greater depth. :-)


 Note that there is a lots of app impossible to crack. We call them freeware
 ;-)

  Ah, the old software should be free meme. Cute but unrealistic
(and off-topic). Let's not get that religious debate going on
cocoa-dev ...

--
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 arch...@mail-archive.com


Re: @loader_path and @executable_path

2009-01-12 Thread Dave Carrigan


On Jan 12, 2009, at 8:47 AM, Joseph Crawford wrote:

I do not know if this is a cocoa question or not, it is an error I  
get when I hit build  go


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


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


The values should be whatever is required to allow the dynamic loader  
to find those frameworks. Typically, @loader_path/../Frameworks/...  
will work, assuming that you install the frameworks in question into  
the Frameworks subdirectory of your app bundle.


Your problem at this moment is that your debug version is not a  
complete bundle. For debugging and testing, you should ensure that the  
DYLD_FRAMEWORK_PATH (and possibly DYLD_LIBRARY_PATH) environment  
variables point to the directory(ies) that contain the frameworks in  
question.


man dyld for more information.

--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA



PGP.sig
Description: This is a digitally signed message part
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Getting the network Machine Icon

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 11:56 AM, Sean McBride s...@rogue-research.com wrote:

 NSImage.  I think it's NSImageNameComputer.

  Yep:

  
http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIcons/chapter_15_section_10.html#

--
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 arch...@mail-archive.com


Make the whole view go full screen

2009-01-12 Thread Jonathan Selander

Hi,

Is there way to make the whole main windows with all its contents  
(including a quartz composition) go full screen, and perhaps even  
scale? If so, how?


Thanks
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 11:56 AM, I. Savant idiotsavant2...@gmail.com wrote:
 On Mon, Jan 12, 2009 at 11:46 AM, Jean-Daniel Dupas
 devli...@shadowlab.org wrote:

 The purpose of code sign is to prevent tempered code to be run inadvertently 
 by an user, not to protect the binary itself.

  Agreed - see my retraction that immediately follows the message you
 responded to. I misunderstood what I read about the technology months
 ago and conceptual error when I read in more detail.

  I do admit wondering how OS X prevented merely swapping one
 signature for another, which is what prompted me to read the
 documentation in greater depth. :-)

And note that even when code signing *is* used as an anti-piracy
measure it doesn't really work. For evidence of this look at the
iPhone, whose ubiquitous code signing is used in a much more draconian
way on OS X, and is intended to prevent piracy. No shortage of cracked
apps there.

 Note that there is a lots of app impossible to crack. We call them freeware
 ;-)

  Ah, the old software should be free meme. Cute but unrealistic
 (and off-topic). Let's not get that religious debate going on
 cocoa-dev ...

I'm pretty sure that's not software should be free, but rather
pointing out the simple fact that the only uncrackable software is
software which doesn't have any protections in the first place. It's
not a commentary on what you *should* do, only that if you're going to
put protections into your app, you need to be realistic about the
ability of others to remove them.

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 arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
I again forgot that reply button reply to sender not to the list,
crazy lists.apple.com! Here is my answer to Ricky:

The button should be disabled by design. It don't intend to interact
with a user at all.

Cocoa Developers cocoa-dev@lists.apple.com

On Mon, Jan 12, 2009 at 7:34 PM, Luca luca.pazzere...@gmail.com wrote:
 I agree with Ricky. Why do you need this?
 By the way, think the better way is to subclass the NSButton, overriding the
 -mouseDown method. Do not call -[super mouseDown:], and it's done - your
 button will not be drawed.

 -- Luca C.

 On 12 Jan 09, at 13:46, Ricky Sharp wrote:

 Do not do this. Users will be very frustrated when they cannot interact
 with that button.

 Why do you think you need this?

 Sent from my iPhone

 On Jan 12, 2009, at 5:55 AM, Donnie Lee lpr...@gmail.com wrote:

 Hi!

 I'd like to create a disabled button that looks like enabled. If I
 just set enabled to no, I got grayed button. Instead I do
 [[theButton cell] setHighlightsBy:NSNoCellMask]; and it looks like
 disabled but continues to receive events. Is there a way to make a
 disabled button that looks like enabled? Thanks in advance!

 Donnie.
 ___

 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/rsharp%40mac.com

 This email sent to rsh...@mac.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/luca.pazzerello%40gmail.com

 This email sent to luca.pazzere...@gmail.com


 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/lprpro%40gmail.com

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

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Getting the network Machine Icon

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 17:56, Sean McBride a écrit :


On 1/11/09 2:31 PM, Sandro Noel said:


I'm looking for a way to programatically get the machine icon from my
servers, just like finder does in the finder.

*SNIP*.

Any suggestions on where to look??


NSImage.  I think it's NSImageNameComputer.


Fine to get the current machine icon, but not to get a remote machine  
icon, just like the Finder does when it display the list of machine on  
the local network.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 12:10 PM, Michael Ash michael@gmail.com wrote:

 And note that even when code signing *is* used as an anti-piracy
 measure it doesn't really work. For evidence of this look at the
 iPhone, whose ubiquitous code signing is used in a much more draconian
 way on OS X, and is intended to prevent piracy. No shortage of cracked
 apps there.

  A very good point.  I said, highly-effective != impossible to
crack ... what I had erroneously referenced earlier is neither. :-)

--
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 arch...@mail-archive.com


Re: NSWindow With Only Close Button?

2009-01-12 Thread glenn andreas


On Jan 12, 2009, at 2:45 AM, Jean-Daniel Dupas wrote:



Le 12 janv. 09 à 01:36, Kyle Sluder a écrit :

On Sun, Jan 11, 2009 at 7:18 PM, Chunk 1978 chunk1...@gmail.com  
wrote:
i noticed the window of the OS Install Assistant of Parallels 4.0  
only

has a close button in the top left corner of the window.  i didn't
know this was possible.  how is this accomplished?


I don't think you can do it in Cocoa; you certainly can't do it in  
IB.

Parallels is a Carbon app.




[[myWindow standardWindowButton: NSWindowZoomButton] setHidden:YES];
[[myWindow standardWindowButton: NSWindowMiniaturizeButton]  
setHidden:YES];



The last time I tried that (and it may have changed), this results in  
tracking holes where those buttons were - so if you click there  
(thinking that you can drag the title bar), nothing will happen (i.e.,  
you won't be able to drag the window like expected).  So at the very  
least, on some systems, this will cause frustrating bug-like behavior.



Glenn Andreas  gandr...@gandreas.com
 http://www.gandreas.com/ wicked fun!
m.o.t.e.s. | minute object twisted environment simulation



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Make the whole view go full screen

2009-01-12 Thread Jean-Daniel Dupas

Le 12 janv. 09 à 18:08, Jonathan Selander a écrit :


Hi,

Is there way to make the whole main windows with all its contents  
(including a quartz composition) go full screen, and perhaps even  
scale? If so, how?


Thanks


See the archives for a bunch of solutions, and pro and cons for each  
one.


http://www.cocoabuilder.com/search/archive/cocoa?words=fullscreen



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 12:10 PM, Michael Ash michael@gmail.com wrote:
 And note that even when code signing *is* used as an anti-piracy
 measure it doesn't really work. For evidence of this look at the
 iPhone, whose ubiquitous code signing is used in a much more draconian
 way on OS X

Usually I just let typos go, but there's a serious chance for
misunderstanding here. I meant to say a much more draconian way THAN
Mac OS X. On the Mac code signing is just a way for users to be able
to trust that an app is from who it says it's from. On the phone it's
used to rigidly control what can and cannot run, much more draconian.

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 arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 12:10 PM, Donnie Lee lpr...@gmail.com wrote:
 I again forgot that reply button reply to sender not to the list,
 crazy lists.apple.com! Here is my answer to Ricky:

 The button should be disabled by design. It don't intend to interact
 with a user at all.

  This is exactly the point Ricky was making. If a button never works
*by design*, a button is the wrong choice for a UI element ... unless,
of course, you're creating some sort of UI mockup generator app or
something similar that merely draws representations of OS X UI
elements. Then again, it wouldn't matter whether the button does
anything or not since it'd not be clickable anyway.

  To answer your question, though, you'd need to override the button's
drawing to always draw the enabled state, ignoring the control's
actual state. Or, you could let the button allow clicking and simply
do nothing. Then it wouldn't appear as broken as if it appeared
enabled and didn't even accept a click.

  The thing to consider is that a user encountering such a control
will assume your application is buggy because it doesn't behave
properly. If you explain what your *goal* is (as you've been asked to
twice already), maybe the community can suggest a much better approach
you hadn't considered.

--
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 arch...@mail-archive.com


Re: Getting the network Machine Icon

2009-01-12 Thread matt . gough


On 12 Jan 2009, at 18:19, Jean-Daniel Dupas wrote:




NSImage.  I think it's NSImageNameComputer.


Fine to get the current machine icon, but not to get a remote  
machine icon, just like the Finder does when it display the list of  
machine on the local network.




I don't know, but you could ask the same question on Carbon-Dev. At  
least one Finder engineer hangs out there.


Matt Gough
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Bonjour server with multiple clients

2009-01-12 Thread Dave DeLong

Let's see if I'm understanding things correctly...

The NSNetService publishes on a port and the server creates an  
NSFileHandle (fh1) for the NSNetService to begin listening to  
connection attempts.  This fileHandle is listening on the same port on  
which the netService was published.


An NSNetServiceBrowser on the client finds the NSNetService and  
notifies via its netServiceBrowser:didFindService:moreComing: delegate  
method.


The client attempts to resolveWithTimeout to the netService.

If the resolving succeeds, then the client attempts to connect to the  
server by creating an NSFileHandle init'd with a fileDescriptor  
gleaned from the [netService addresses];  This now opens a port on the  
client.


(This is where things start getting fuzzy)
The server, meanwhile, is notified that someone is trying to hook up  
to fh1, and gets a new fileHandle via the notification object sent  
along in the NSFileHandleConnectionAcceptedNotification.


Is this new fileHandle different from the original fileHandle on the  
server?  Is this new fileHandle operating on a different port than the  
original?  Is this even the proper way to be going about this?  Am I  
anywhere close to getting this working?


Thanks a ton!

Dave

On Jan 9, 2009, at 7:10 PM, Andrew Farmer wrote:


On 09 Jan 09, at 17:57, Markus Spoettl wrote:
How does one go about advertising a service via bonjour like in the  
Picture Sharing example AND allow multiple connections instead of  
just one? Is it as simple as creating multiple listeningSockets? Or  
create a new listening socket each time you get a connection to the  
existing one?


Reading a tutorial on network programming may prove helpful here.  
Here's one:


 http://beej.us/guide/bgnet/output/html/multipage/index.html

The short answer is that a single listening socket is sufficient; a  
new socket representing a connection is created when each client  
connects.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Using UIImageView for animations

2009-01-12 Thread David Duncan

On Jan 10, 2009, at 12:01 PM, Alex Strand wrote:

I'm taking a set of 10-20 jpegs that I'd like to animate.  I started  
out just using a UIImageView using setAnimationImages: and  
everything worked fantastically in the simulator but testing it on  
my device basically makes it slow to the point where it is  
unresponsive.  I've done some searching around and some people  
indicate that they are able to use CALayers to get this same effect  
but before going down that path I thought I would ask you folks.



How well this will work is highly dependent on how large each of these  
images are. Assuming that they are full screen in size (since you  
mention a performance issue) then 1 JPEG will decompress to about  
600K, and thus 10-20 to between 6-12MB. This is a LOT of memory, and  
you are likely to see many different issues (although performance in  
this case would likely be due to having a number of other views or  
cached images also loaded).


UIImageView basically does the same thing that you would do with a  
CALayer to animate images in most cases anyway. There are alternative  
means by which you can animate an image via a CALayer, but it comes  
with other restrictions (primarily on image size).


On Jan 11, 2009, at 9:04 AM, Glenn Bloom wrote:

I don't think I see this issue in my own code using UIImageView with  
a like number of JPEG's.  How large are yours?  For a variety of  
reasons, I have found that optimizing mine as 150KB or less each is  
acceptable for 480 * 320 pixel images.


It sounds like you are considering file size. File size is irrelevant  
in terms of graphical performance of compressed image formats, as the  
images will need to be (at least partially) decompressed for usage. In  
the case of a fullscreen JPEG image, it will be fully decompressed  
into a 32-bit per pixel format, which means the actual memory usage is  
320x480x4=600KB. If you are seeing acceptable performance, then you  
are likely not pushing up against the maximum amount of memory the  
graphics subsystem can reference (24MB) and thus not seeing the  
performance cliff that going past that limit causes.


On Jan 11, 2009, at 10:06 AM, Robert Marini wrote:

As Glenn indicated, this is largely a factor of the size of the  
images.  Layers are considerably lighter weight than Views (with the  
associated functionality loss).


Views are based on Layers, so in that respect a view is heavier than a  
layer, but in general usage terms it is not so much so that I would  
consider using a layer over a view if I needed any feature that a view  
might offer.


Of course, doing what you want to do - depending on the animation  
involved - might simply be having two image views and animating  
between then while changing their image backings (UIImageView is the  
presentation layer for a UIImage and so it is generally most  
appropriate to have only the max number of UIImageViews that you  
need to display at once in memory).


This might be an acceptable solution, although to control memory you  
should not use +imageNamed: to load these images (and instead use  
imageWithContentsOfFile:) as you would likely run into the exact same  
performance problem if you did. This may also end up with other  
performance issues unfortunately.

--
David Duncan
Apple DTS Animation and Printing

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: dragging images to the finder

2009-01-12 Thread Heinrich Giesen


On 12.01.2009, at 05:50, Nick Zitzmann wrote:


Assuming you are trying to create a picture file here, you have to use
the pasteboard type CorePasteboardFlavorType 0x6675726C to get the
Finder to accept the drag, and it must contain a file URL string
pointing to the source image that you must write to the disk
somewhere.



You do not really have to create some data for this PB flavor type.  
It is much simpler.
You do not even have know what such a flovor means (I guess it is  
part of AppleScript).


Do this: somewhere tell the pasteBoard what types you use for dragging:

   NSPasteboard *pb = [NSPasteboard pasteboardWithName:NSDragPboard];
   [pb declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType]  
owner:self];



And eventually (I hope you know where the image is an the disc) you  
feed the pasteBoard with:


   BOOL rtn = [pb setPropertyList:[NSArray  
arrayWithObject:locationOfTheImage]

  forType:NSFilenamesPboardType];

(Yes, you need an NSArray of files! ).

Now finally have a look at the dragPasteboard. It contains data for:

   NSFilenamesPboardType
   NeXT filename pasteboard type
   CorePasteboardFlavorType 0x6675726C ( 'furl' )
   Apple URL pasteboard type  (internal name for NSURLPboardType)
   CorePasteboardFlavorType 0x68667320  ( 'hfs ' )


Do not underestimate the power of the PasteBoardServer!

   Godd luck,  Heinrich

--
Heinrich Giesen
gies...@acm.org


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSRuleEditor bindings

2009-01-12 Thread cacaodev

Hello,

Has anyone achieved to use NSRuleEditor with the rows bindings. I  
can use it successfully when it's binded to an ivar of a controller  
object.


Now i'm trying to bind rows to a NSArrayController. The first time I  
select an object of the NSArrayController , the rows appear  
correctly , then when I select another object, every rows disappear  
and I can't even add new rows programatically.


Is there any sample code of NSRuleEditor+bindings somewhere, I can't  
find anything in the doc.


Thanks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Security With Show Package Contents?

2009-01-12 Thread Graham Lee
On 12/01/2009 17:25, Michael Ash michael@gmail.com wrote:

 On the Mac code signing is just a way for users to be able
 to trust that an app is from who it says it's from.

I agree that it the underlying technology has the capability to provide
that, I'm not sure that code signing on the Mac currently does provide that
trust. AFAICT it currently only lets users trust that app v1.0.1 came from
the same people as app v1.0, and only then thanks to the _lack_ of any UI
which would appear in the failure case - and only _THEN_ if the app tries to
perform one of a small number of privileged operations.

Cheers,
Graham.

--
Graham Lee
Senior Macintosh Software Engineer, Sophos Plc.
+44 1235 540266
http://www.sophos.com/


Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United 
Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 The button should be disabled by design. It don't intend to interact
 with a user at all.

  This is exactly the point Ricky was making. If a button never works
 *by design*, a button is the wrong choice for a UI element

I don't like to discuss ideological part of the thing, I ask only
about a technical implementation.

  you'd need to override the button's
 drawing to always draw the enabled state, ignoring the control's
 actual state.

Too dirty solution.

 Or, you could let the button allow clicking and simply
 do nothing.

As I already did and asked about more beautiful ways. If there is no
more beautiful way -- not a big problem.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 12:57 PM, Donnie Lee lpr...@gmail.com wrote:

  you'd need to override the button's
 drawing to always draw the enabled state, ignoring the control's
 actual state.

 Too dirty solution.


  :-D  That's immensely entertaining.

--
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 arch...@mail-archive.com


Re: Mac Pro memory sizes

2009-01-12 Thread Scott Ribe
 leads me to believe that if I need an address space of more than 4GB then I
 should be using 64 bit computing.
 
 True.

Also note that loading of various runtime libraries will take up a big chunk
of address space, so needing an address space of more than 4GB translates
very roughly to need to manipulate more than about 2GB of data.


-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee

On Jan 12, 2009, at 12:57 PM, Donnie Lee wrote:
The button should be disabled by design. It don't intend to  
interact

with a user at all.


This is exactly the point Ricky was making. If a button never works
*by design*, a button is the wrong choice for a UI element


I don't like to discuss ideological part of the thing, I ask only
about a technical implementation.


you'd need to override the button's
drawing to always draw the enabled state, ignoring the control's
actual state.


Too dirty solution.


What's dirty about it?  Note that as soon as you call a solution  
dirty you're dangerously close to discussing ideology.


You defined the problem as wanting a button that is disabled but looks  
enabled.  You yourself said you want the button to draw as if it were  
enabled despite the fact that it is disabled.  The above solution  
basically echoes your exact requirements, so if it is dirty, then your  
application design must also be dirty.  Why is it not dirty to present  
a button whose appearance is a lie?


As others have already asked: what are you trying to accomplish?  What  
is the usage scenario you are trying to achieve, and what is its  
purpose?


If you want a better answer (and there may not be one), you need to  
provide more context.


--Andy






Or, you could let the button allow clicking and simply
do nothing.


As I already did and asked about more beautiful ways. If there is no
more beautiful way -- not a big problem.

Donnie.
___

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/aglee%40mac.com

This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Bonjour server with multiple clients

2009-01-12 Thread Kyle Sluder
On Mon, Jan 12, 2009 at 12:32 PM, Dave DeLong davedel...@me.com wrote:
 The NSNetService publishes on a port and the server creates an NSFileHandle
 (fh1) for the NSNetService to begin listening to connection attempts.  This
 fileHandle is listening on the same port on which the netService was
 published.

NSNetService has nothing whatsoever to do with the actual connection.
The server creates the socket/NSFileHandle to listen to connections,
then provides that info to the NSNetService which publishes that info
over Bonjour.

NSNetService is just a way to publish a service name, hostname and a
port in a place others can find it.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 As others have already asked: what are you trying to accomplish?

I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
Then simply subclass NSButton, add an ivar called fakeEnabled, then  
override the mouseDown and mouseUp events to do the following:


-(void)mouseDown:(NSEvent*)event{
  if (fakeEnabled==NO){
[super mouseDown:event];
  }
}

Do the same for mouseUp, and just have a getter and setter for  
fakeEnabled. Voilà: a button that always looks enabled but can be set  
to respond only part of the time.


Dave

Sent from my iPod

On Jan 12, 2009, at 11:20 AM, Donnie Lee lpr...@gmail.com wrote:


As others have already asked: what are you trying to accomplish?


I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!

Donnie.
___

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/davedelong%40me.com

This email sent to davedel...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Randall Meadows

On Jan 12, 2009, at 11:20 AM, Donnie Lee wrote:


As others have already asked: what are you trying to accomplish?


I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!


Because, frankly, that doesn't make any sense (to put it nicely), and  
they're asking WHY you want to do that in anticipation of giving you a  
better solution.


They've given you a great answer, which you've rebuffed, and now  
you're scolding them for *continuing* to try to help you.  Not exactly  
the Dale Carnegie method...

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
That's not better than my way. I never need to handle events from this button.

On Mon, Jan 12, 2009 at 9:28 PM, Dave DeLong davedel...@me.com wrote:
 Then simply subclass NSButton, add an ivar called fakeEnabled, then override
 the mouseDown and mouseUp events to do the following:
...
 Do the same for mouseUp, and just have a getter and setter for fakeEnabled.
 Voilà: a button that always looks enabled but can be set to respond only
 part of the time.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Maybe people ask because they're trying to help?

Maybe you will first think your head before ask your questions? Your
questions CAN'T help to solve my problem, so please don't flood in
list.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 1:20 PM, Donnie Lee lpr...@gmail.com wrote:

 I try to create a disabled button that looks like enabled button
 :))) It's so easy to understand, why do you ask more more and
 more???!!!

  Seriously?

  A solution has already been handed to you - one which you rejected
because it doesn't meet with your own ideals - that will do exactly as
you asked. Professionals with a long history of providing good
guidance on this list are asking this question repeatedly because what
you are doing has a 95% chance of being completely and utterly
bone-headed, though everybody who responded was heretofore careful to
word that point gently*. Your response to this concern, however, seems
to include an insult (so easy to understand).

  Surely you didn't intend to insult those who helped you, so it's
probably best to either graciously accept the suggested solution
(which seems 'dirty' because you're working hard to purposefully break
an interactive control) and leave the conversation at that OR you
could try actively participating in the discussion, rather than
demanding that others serve you on your terms or shut up.

  Just a thought.

--
I.S.


* Though patience is a virtue, it is in limited supply. First come,
first served. Limit one serving per thread.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
So what you're saying is you want a button that doesn't do anything?   
In that case, just don't hook the button's action up to anything...


Dave

Sent from my iPod

On Jan 12, 2009, at 11:32 AM, Donnie Lee lpr...@gmail.com wrote:

That's not better than my way. I never need to handle events from  
this button.


On Mon, Jan 12, 2009 at 9:28 PM, Dave DeLong davedel...@me.com  
wrote:
Then simply subclass NSButton, add an ivar called fakeEnabled, then  
override

the mouseDown and mouseUp events to do the following:

...
Do the same for mouseUp, and just have a getter and setter for  
fakeEnabled.
Voilà: a button that always looks enabled but can be set to respon 
d only

part of the time.

___

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/davedelong%40me.com

This email sent to davedel...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


RE: Disabled button looks like enabled

2009-01-12 Thread Jon C. Munson II
Why not just create a picture of an enabled button (say, a JPG) and display
that?  If you need text, you can create a blank button and put a label
over it which you can then change...etc...

If you don't need a button in the traditional sense, why carry all that
overhead with you in the app?

BTW, the accomplishment question was asked in the general sense, not the
specific sense.  That way the gurus can possibly provide you with a better
way.

Peace, Love, and Light,

/s/ Jon C. Munson II

-Original Message-
From: cocoa-dev-bounces+jmunson=his@lists.apple.com
[mailto:cocoa-dev-bounces+jmunson=his@lists.apple.com] On Behalf Of
Donnie Lee
Sent: Monday, January 12, 2009 1:21 PM
To: Cocoa Developers
Subject: Re: Disabled button looks like enabled

 As others have already asked: what are you trying to accomplish?

I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!

Donnie.
___

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/jmunson%40his.com

This email sent to jmun...@his.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 1:34 PM, Donnie Lee lpr...@gmail.com wrote:

 That's not better than my way.
...
 Maybe you will first think your head before ask your questions? Your
 questions CAN'T help to solve my problem, so please don't flood in
 list.


 Ugh ... READ:   http://www.slash7.com/pages/vampires


--
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 arch...@mail-archive.com


Re: debugging hard-to-locate error in NSApplication delegate

2009-01-12 Thread Quincey Morris

On Jan 12, 2009, at 08:11, Greg Beaver wrote:


Does anyone have working code that shows an application delegate in a
core data document-based app?  I'm trying to intercept
applicationShouldOpenUntitledFile: in order to open the last-saved
document.  I have code that works, but it causes this error:

*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil

some time between the setting of the delegate, which I did by  
inserting

this object into the nib and setting the delegate programmatically.
linking from IB did not properly set the delegate (init and
applicationDidFinishLaunching: were called, but
applicationShouldOpenUntitledFile: was never called):

@implementation GreenwoodAppDelegate

- (void) init
{
   [super init];
   applicationHasStarted = NO;
   if (![[NSApplication sharedApplication] delegate]) {
   [[NSApplication sharedApplication] setDelegate:self];
   }
}


This isn't going to work because your app delegate object is in your  
NIB file and is (re)created at startup by unarchiving. Therefore,  
'initWithCoder' will be called instead or 'init'.


I think you'd be better off setting your application's delegate outlet  
to the app delegate object in your main NIB file after all, and then  
trying to work out why applicationShouldOpenUntitledFile: isn't  
behaving as expected.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee

On Jan 12, 2009, at 1:34 PM, Donnie Lee wrote:

Maybe people ask because they're trying to help?


Maybe you will first think your head before ask your questions? Your
questions CAN'T help to solve my problem, so please don't flood in
list.


Please don't reply to me on the list when I've specifically said I was  
replying off-list.


Are you just trolling?  Because here you are flooding the list when I  
replied off-list.


--Andy

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 1:20 PM, Donnie Lee lpr...@gmail.com wrote:
 As others have already asked: what are you trying to accomplish?

 I try to create a disabled button that looks like enabled button
 :))) It's so easy to understand, why do you ask more more and
 more???!!!

Because, to be blunt, it appears that you're trying to do something
stupid, and the people on this list are trying to help you find a
better way to do whatever it is that you're trying to do.

Analogy: someone writes to a carpenter group complaining that they're
having trouble driving nails with their forehead. Of course the
carpenters are aghast. Half of them say, use a hammer! The other
half ask, why are you trying to drive nails with your forehead?

You're trying to drive nails with your forehead. Of course people are
going to ask why. If you want to have a productive discussion, simply
explain why you insist on driving them with your forehead instead of
with a hammer. If you have a good reason that nobody thought of,
everybody will go home happy. If, as seems much more likely, you don't
actually have a good reason, then we can explain to you the error of
your ways and then everybody will go home happy.

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 arch...@mail-archive.com


Re: Mac Pro memory sizes

2009-01-12 Thread Nick Zitzmann


On Jan 12, 2009, at 9:23 AM, Michael Ash wrote:


That's it! Pointer size and native 64-bit integers are the only
difference between the two!



In addition to what Mike said, the transition from X86 to X86-64  
includes a few other benefits besides larger pointers and native  
integers. The number of registers were doubled, and the calling  
conventions were changed so that 80% of the time function/method  
arguments are stored in CPU registers instead of being placed in a  
four-byte-aligned position on the stack. And that 20% of cases only  
happen when you pass in a structure larger than 128 bits, or pass in  
an unaligned structure, or have a function that takes more than 6  
arguments.


So typically a program ported from X86 to X86-64 will run just  
slightly faster, especially if the program passes around a lot of 64- 
bit arguments. This doesn't apply to the PPC64 architecture, which is  
almost unchanged from PPC, and so PPC64 programs are typically slower  
due to the extra overhead.


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 arch...@mail-archive.com


Re: Getting the network Machine Icon

2009-01-12 Thread Sandro Noel

Thanks guy's i'll ask in the Carbon-dev list.

Sandro Noel.

On 11-Jan-09, at 2:31 PM, Sandro Noel wrote:


Greetings

I'm looking for a way to programatically get the machine icon from  
my servers, just like finder does in the finder.
for every type of mac it has a different icon, and for windows  
computers, it;s the nice crash screen icon.


I would like my application to represent the network hosts as finder  
does.


I looked over the internet but could not find how finder does it.
I did however find the icons in /System/Library/CoreServices/ 
CoreTypes.bundle/Contents/Resources/


Any suggestions on where to look??

Thank you in advance.
Sandro Noel.
___

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/sandro.noel%40mac.com

This email sent to sandro.n...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 So what you're saying is you want a button that doesn't do anything?

Exactly.

 In that case, just don't hook the button's action up to anything...

Already did it, just tried to remove this button from system observers
to save system resources putting it in disabled state.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
You read too much Tolkien. It's hard to me to trace which messages
sent to list and which is not because crazy lists.apple.com software
didn't provide reply-to field and I enter to address manually.

PS: Now only reply to all button.

On Mon, Jan 12, 2009 at 9:45 PM, Andy Lee ag...@mac.com wrote:
 On Jan 12, 2009, at 1:34 PM, Donnie Lee wrote:

 Maybe people ask because they're trying to help?

 Maybe you will first think your head before ask your questions? Your
 questions CAN'T help to solve my problem, so please don't flood in
 list.

 Please don't reply to me on the list when I've specifically said I was
 replying off-list.

 Are you just trolling?  Because here you are flooding the list when I
 replied off-list.

 --Andy


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


[SOLVED] Re: debugging hard-to-locate error in NSApplication delegate

2009-01-12 Thread Greg Beaver
Quincey Morris wrote:
 On Jan 12, 2009, at 08:11, Greg Beaver wrote:

 Does anyone have working code that shows an application delegate in a
 core data document-based app?  I'm trying to intercept
 applicationShouldOpenUntitledFile: in order to open the last-saved
 document.  I have code that works, but it causes this error:

 *** -[NSCFArray insertObject:atIndex:]: attempt to insert nil

 some time between the setting of the delegate, which I did by inserting
 this object into the nib and setting the delegate programmatically.
 linking from IB did not properly set the delegate (init and
 applicationDidFinishLaunching: were called, but
 applicationShouldOpenUntitledFile: was never called):

 @implementation GreenwoodAppDelegate

 - (void) init
 {
[super init];
applicationHasStarted = NO;
if (![[NSApplication sharedApplication] delegate]) {
[[NSApplication sharedApplication] setDelegate:self];
}
 }

 This isn't going to work because your app delegate object is in your
 NIB file and is (re)created at startup by unarchiving. Therefore,
 'initWithCoder' will be called instead or 'init'.

 I think you'd be better off setting your application's delegate outlet
 to the app delegate object in your main NIB file after all, and then
 trying to work out why applicationShouldOpenUntitledFile: isn't
 behaving as expected.
Hi,

I figured out the problem from:

http://www.cocoadev.com/index.pl?NSApplication

At the bottom of the page, someone had a similar issue.  Turns out, I
thought my Greenwood.xib was the main nib, instead of MainMenu.xib. 
Putting the app delegate in mainmenu.nib and linking in IB causes
expected behavior, and removes the exception.

Thanks for all of the help, that exception trick will be extremely
useful, I run into track the exception source all the time, although
usually it's much easier to debug.

Thanks,
Greg
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


NSTableColumn won't display int values; currently displaying as Yes(/No) (which I didn't think possible)

2009-01-12 Thread Doug Knowles
Hi,
I have a simple table bound to an array controller which manages a list of
custom objects. One of the table columns is bound to a count property of
the custom object; the count property is accessed via a getter that
returns a calculated primitive int.

For weeks, this table worked as expected and displayed the count value in
the appropriate column.

At some point, the column stopped displaying values.  I checked the
bindings, which are fine. As an experiment, I removed the NSNumberFormatter
I had associated with the column. When I did this, the column started
displaying Yes or No in every row. (No for zero, Yes for everything
else, as you'd expect.)

I tried adding a new column to the view and binding it to the same value, in
case a default somewhere had been changed, and I get the same result.

The funny thing, is, there are times I would like to render Yes and No
for BOOL's, but I thought a NSValueTransformer was required to do that.  At
the moment, I'm in a position where I'm considering using a value
transformer to get the normal behavior of displaying an int as an
number.

Did I accidentally enable some ability to display int's as Yes/No, and, if
so, how do I turn it off?  And on again, because I know I'll want it
somewhere else, later. :-)

TIA,
Doug K;
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Because, to be blunt, it appears that you're trying to do something
 stupid, and the people on this list are trying to help you find a
 better way to do whatever it is that you're trying to do.

The main problem that people think that I try something stupid.
Instead of technical discussion they try to teach me what should I do
and how should I do it. Like a religious zombies, seriously.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Getting the network Machine Icon

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 1:52 PM, Sandro Noel sandro.n...@mac.com wrote:

 Thanks guy's i'll ask in the Carbon-dev list.

  Sorry - I didn't see the remote part of the requirement at first.
After spending some time searching the docs, tech notes, and even some
headers for this myself (because it's an intriguing question), I
couldn't find any good leads either. I'll second the suspicion that
Carbon will likely be needed, but there doesn't appear to be a
well-documented way to do so.

  If you wouldn't mind following up on this thread with any references
you might get on carbon-dev (for those who aren't subscribed), it
would be greatly appreciated.

--
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 arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Robert Marini
More often than not, optimizing a user's experience should be the  
larger concern than worrying about an NSButton's memory footprint.


-rob.

On Jan 12, 2009, at 1:43 PM, Donnie Lee wrote:


So what you're saying is you want a button that doesn't do anything?


Exactly.


In that case, just don't hook the button's action up to anything...


Already did it, just tried to remove this button from system observers
to save system resources putting it in disabled state.
___

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/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com




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 arch...@mail-archive.com

Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee
But it will still visually respond to mouse clicks, which is not  
desired, in my interpretation of the problem statement.  [[theButton  
cell] setHighlightsBy:NSNoCellMask] presumably takes care of that --  
but then the user might still be able to select the button by tabbing  
to it.


If a single NSButton is used, I think the easiest thing is to disable  
it and then override its drawing behavior, as I. Savant suggested.   
But it depends on the context of what the application is trying to  
do.  If the application displays a screenful of different fake UI  
components (for example, as a sort of mockup, as I.S. posited), it  
would be impractical to have a subclass for every control/cell.  In  
that case, some sort of offscreen drawing makes sense -- draw the  
whole window/view offscreen, not even bothering to disable the  
controls, and blit it to the real window.


--Andy

On Jan 12, 2009, at 1:35 PM, Dave DeLong wrote:

So what you're saying is you want a button that doesn't do  
anything?  In that case, just don't hook the button's action up to  
anything...


Dave

Sent from my iPod

On Jan 12, 2009, at 11:32 AM, Donnie Lee lpr...@gmail.com wrote:

That's not better than my way. I never need to handle events from  
this button.


On Mon, Jan 12, 2009 at 9:28 PM, Dave DeLong davedel...@me.com  
wrote:
Then simply subclass NSButton, add an ivar called fakeEnabled,  
then override

the mouseDown and mouseUp events to do the following:

...
Do the same for mouseUp, and just have a getter and setter for  
fakeEnabled.
Voilà: a button that always looks enabled but can be set to  
respond only

part of the time.

___

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/davedelong%40me.com

This email sent to davedel...@me.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/aglee%40mac.com

This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Need help on nsfontmanager.

2009-01-12 Thread Alan Shouls

Hi,



I want to use multiple font traits .

I.e..,making the text both bold and italic (LIKE BOLDITALIC )

Is this possible?


It depends on the font. Some fonts have just a regular form, others  
have a bold form as well as a regular form, others an italic form, a  
bold form, and a bold+italic form.  If there is a bold+italic form of  
a particular font you can set it.


If you play about with TextEdit you will be able to see the different  
forms that various fonts have. Helvetica has:


- Regular (normal)
- Oblique (italic)
- Bold (bold)
- Bold Oblique (bold+italic)

A font like Impact has just a Regular

Hope that this helps

Best regards

Alan Shouls
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


didReceiveMemoryWarning doesn't release view...

2009-01-12 Thread Oscar Alejandro Alvarado Prieto
Hi there.
I'm using a table view controller inside a navigation controller wich is a
view controller of a tab bar controller. As I want take care of memory
warnings, I put the table view in a separated nib file, setting the file's
owner class to my table view controller subclass and all other thinks (view
outlet, nib file name, etc). It seems to work fine but when a memory warning
is generated using simulator, the table view is not released.
I set breakPoints on  setView and loadView and they are called only first
time view is needed.

I read that  the view is released if it doesn't have a superview but I
discovered my view has a UITransitionView superview ¿...?.

Please, is there someone who know what could be going on?.

I'm stuck with this silly thing.

Tx in advance.



-- 
Oscar A. Alvarado
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: NSWindow With Only Close Button?

2009-01-12 Thread Gordon Apple
Set the size to zero instead.  You can do it in a window controller:

[[[self window] standardWindowButton:NSWindowMiniaturizeButton]
setFrame:NSZeroRect];
[[[self window] standardWindowButton:NSWindowZoomButton]
setFrame:NSZeroRect];


On 1/12/09 12:03 PM, cocoa-dev-requ...@lists.apple.com
cocoa-dev-requ...@lists.apple.com wrote:

 On Jan 12, 2009, at 2:45 AM, Jean-Daniel Dupas wrote:
 
 
 Le 12 janv. 09 à 01:36, Kyle Sluder a écrit :
 
 On Sun, Jan 11, 2009 at 7:18 PM, Chunk 1978 chunk1...@gmail.com
 wrote:
 i noticed the window of the OS Install Assistant of Parallels 4.0
 only
 has a close button in the top left corner of the window.  i didn't
 know this was possible.  how is this accomplished?
 
 I don't think you can do it in Cocoa; you certainly can't do it in
 IB.
 Parallels is a Carbon app.
 
 
 
 [[myWindow standardWindowButton: NSWindowZoomButton] setHidden:YES];
 [[myWindow standardWindowButton: NSWindowMiniaturizeButton]
 setHidden:YES];
 
 
 The last time I tried that (and it may have changed), this results in
 tracking holes where those buttons were - so if you click there
 (thinking that you can drag the title bar), nothing will happen (i.e.,
 you won't be able to drag the window like expected).  So at the very
 least, on some systems, this will cause frustrating bug-like behavior.
 
 
 Glenn Andreas  gandr...@gandreas.com
   http://www.gandreas.com/ wicked fun!
 m.o.t.e.s. | minute object twisted environment simulation

G. Apple



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 18:54:19, Donnie Lee wrote:


You read too much Tolkien. It's hard to me to trace which messages
sent to list and which is not because crazy lists.apple.com software
didn't provide reply-to field and I enter to address manually.

PS: Now only reply to all button.


Ever heard of Rules?

Any recipient contains: cocoa-dev@lists.apple.com

Move message to mailbox: Cocoa Dev

Simple, eh?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Robert Marini
There is a reason *why* disabled buttons have a different appearance.   
The members of this list are curious as to why you would want to  
override that. And yes, if you don't have a good reason they will  
certainly point that out.


-rob.

On Jan 12, 2009, at 1:57 PM, Donnie Lee wrote:


Because, to be blunt, it appears that you're trying to do something
stupid, and the people on this list are trying to help you find a
better way to do whatever it is that you're trying to do.


The main problem that people think that I try something stupid.
Instead of technical discussion they try to teach me what should I do
and how should I do it. Like a religious zombies, seriously.

Donnie.
___

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/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com




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 arch...@mail-archive.com

Re: Disabled button looks like enabled

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 20:24, Donnie Lee a écrit :

I am curious to know more about theses system observers. Can you  
explain

us what is it ?


Cocoa observers which sends mouse events, keyboard events etc.



Hardware event are received by the kernel that send them to the window  
server that forward them to the active application.
Then NSApplication receive them and send them to the key window (or  
the target window which is not always the key window for mouse events).

Then the window object try to resolve the target responder.

Each NSView is a responder. I really don't understand how you're  
trying to reduce system resource usage.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Release vs. autorelease

2009-01-12 Thread Mohan Parthasarathy
Hi,

In places other than dealloc where memory needs to be released (e.g,
reassigning pointer to objects), is there a difference in doing autorelease
or release of the object in terms of perfomance etc. ? I  can see that the
memory is released immediately in one case whereas in the other it is
slightly delayed. Is there any other difference ? What is the right thing to
do ?

thanks
mohan
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 There is a reason *why* disabled buttons have a different appearance.  The
 members of this list are curious as to why you would want to override that.
 And yes, if you don't have a good reason they will certainly point that out.

I see there is unavoidable problem with my fake button and
Accessibility tools which may happens. I planned to use it to emulate
gradient bottom bar (under Source List control), looks like in
Mail.app. I created three buttons, two gradient action-buttons and one
gradient non-clickable button with image aligned to right. This image
is a three lines which act as
additionalEffectiveRectOfDividerAtIndex: of NSSplitView. It looks
really nice but the fact that is a button...can it hurt people with
Accessibility devices?

Really, I don't like all these additional libraries that try to
emulate gradient bottom bar, because they redraw these controls by
itself, and I would like to use only Apple controls.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Then the window object try to resolve the target responder.

 Each NSView is a responder. I really don't understand how you're trying to
 reduce system resource usage.

Hmm, I don't know internals of Cocoa, I hypothesized that putting a
button in a disabled state can remove focus areas handled by mouse or
something else, which can save a little system resources without big
pain. Are you 100% sure that disabled and enabled buttons takes
identical amount of system resources?

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


  1   2   >