Re: mySQL client lib linking problem...

2009-11-23 Thread Karolis Ramanauskas
Glad you found your solution... This is out of my league. Quite interesting
though, so I will creep this exchange.

Peace

On Mon, Nov 23, 2009 at 1:32 AM, Michael Davey  wrote:

> Well, it may not have been the most elegant of solutions, but it works...
>
> Basically I downloaded the binary tarballs for each of the relevant
> architectures from the mySQL download page, and then used lipo to stitch the
> client libraries into the universal binary that I needed.  As an aside I
> have the 64bit PPC version as well - does anyone know if this is needed?
>
> Many thanks to all for your help,
>
> Mikey
>
> On 23 Nov 2009, at 18:10, Andrew Farmer wrote:
>
> > On 22 Nov 2009, at 22:33, Michael Davey wrote:
> >> Yeah, thanks - but given that I cannot even get it to build I will worry
> about that once I get to the point where it is distributable ;o)
> >
> > Fair enough!
> >
> > For what it's worth, you should be able to compile a universal MySQL by
> downloading the source and running:
> >
> > export CFLAGS=-arch ppc -arch i386 -arch x86_64
> > export CXXFLAGS=-arch ppc -arch i386 -arch x86_64
> > export LDFLAGS=-arch ppc -arch i386 -arch x86_64
> > ./configure --enable-static --disable-dependency-tracking
> > make
> > sudo make install
> >
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/karolisr%40gmail.com
>
> This email sent to karol...@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


NSStream Operation Timed out issue

2009-11-23 Thread Ramesh P
Hi all,
I have an cocoa application which used to transfer files to server
using the NSStream SSL Socket connection.
For every successful file transaction server will send a response to
my application. This is working fine for small files. But when i
transfer big files my application throwing an error after 75 seconds
and the socket connection also closed.
The error is
Domain=NSPOSIXErrorDomain Code=60 "Operation could not be completed.
Operation timed out"

This is exactly happens after 75 seconds from the file transfer
starting time.  There is no error If the file transfer takes less than
75 seconds.

How can i fix this time issue? Is there any option to set the time in
NSSTream?
Thanks in Advance.


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


How to avoid text distortion

2009-11-23 Thread padmakumar

Dear Rob,

Thanks a lot for your valuable inputs, I have fixed the issue of 
distorted fonts/text in all NSTextFields which are not selectable and  
not editable(text for user info / display pupose only)and labels by 
changing the default background color of all NSTextFields to the same 
color(Mercury) of the page background with 100% opacity.


Now,  one of the NSTextField which is provided in my application for 
user to edit and select with White background is present. The above fix 
is not working , In this NSTextField having background color  "White / 
Snow" with Opacity 100%.


So please let me know some inputs So that I can make the font edges 
sharp and clear in case of a Editable White background NSTextFields.


Regards
pappan

Message: 8
Date: Fri, 20 Nov 2009 15:41:10 +1000
From: Rob Keniger 
Subject: Re: How to avoid text distortion
To: Cocoa-Dev List 

On 20/11/2009, at 3:23 PM, padmakumar wrote:

 One more point is that I am using Xcode 3.2  in Snow Leopard (Version
 10.6.2) and  in System  Preference -> Appearence ->
"Use LCD font smoothing when available" option is disabled  , again 
font  and text are  displayed perfectly ie
with out any distortion. If I enable this option which is enabled by 
default this problem occurs. But  this problem

happens only with  the application I have developed.

I suspect you are using a layer-backed view. NSTextFields with no 
background color will display
without sub-pixel anti-aliasing on layer-backed views. If you want the 
text to have sub-pixel anti-aliasing, give the text field a background 
color.

--
Rob Keniger




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CoreData abstract entity migration issue

2009-11-23 Thread jonat...@mugginsoft.com
On 22 Nov 2009, at 21:59, Quincey Morris wrote:

> On Nov 22, 2009, at 03:39, jonat...@mugginsoft.com wrote:
> 
>> I have a very simple object model that contains, along with 4 or 5 others, 
>> an abstract entity.
>> The app uses NSPersistentDocument.
>> 
>> I have created a new model version that changes a transient property to a 
>> modelled property in an entity derived from the above abstract entity.
>> I have created my mapping model and configured the PSC with 
>> NSMigratePersistentStoresAutomaticallyOption.
>> 
>> Migration always fails with multiple validation errors.
>> 
>> Looking at the data mapping model I can see that the abstract class is not 
>> represented.
>> 
>> Is this to be expected?
>> 
>> Is migration of abstract entities troublesome?
>> Some web statements state a that a mapped migration of abstract entities is  
>> not supported. Some other evidence that it is.
>> A different model change - adding a simple BOOL attribute - also fails.
>> 
>> Will a manual editing of the mapping model to represent the abstract entity 
>> help?
> 
> It's a while since I had to deal with this, and it was under Leopard, so I 
> might be a bit hazy ...
> 
> The automatically generated mapping model for an abstract entity does not do 
> the right thing. In my case, the abstract entity contained parent (to-1) and 
> child (to-many) relationships, and the model was missing the mapping for the 
> child relationship. I was able to fix it by creating the missing mapping 
> manually (using a mapping in a different entity as a guide).
> 
> You should be able to do something similar. If you examine the mapping model 
> it should be fairly obvious what's missing from the abstract entity, and it 
> shouldn't be hard to manually add whatever's necessary to create the BOOL 
> attribute. (If it's not obvious, I'd first try adding the attribute to a 
> non-abstract entity and see what turns up in the mapping model, then back out 
> of the change and do the corresponding thing in the abstract entity.)
Thanks for the reply.

In my case the abstract entity is entirely absent in the mapping.
If I modify the model (and thus break it) to make the abstract entity concrete 
then it appears in the mapping.

I will try recreating the abstract mapping manually.
Looks like a bug report might be appropriate.
> 
> HTH
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/jonathan%40mugginsoft.com
> 
> This email sent to jonat...@mugginsoft.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


A question of legality...

2009-11-23 Thread Michael Davey
I want to share with you all the 4 arch version of the mysql libs that I went 
to some trouble to make today, but in light of the information given to me 
today by Andrew Farmer, I do not know if this is legal.

Anyone know? ___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTreeController content array bindings

2009-11-23 Thread Mike Abdullah
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/Troubleshooting.html#//apple_ref/doc/uid/TP40002148

Don't bind to an NSMutableArray. Bind to an array property of an object.

On 23 Nov 2009, at 03:20, Mazen M. Abdel-Rahman wrote:

> Hi All,
> 
> I am having trouble binding an NSTreeController's content array to an 
> NSMutableArray through interface builder.
> 
> In the bindings inspector of Interface Builder I bind to file's owner - which 
> in my case is a subclass of NSWindowController, and set the model key path 
> the the name of the NSMutableArray I want to bind to.  This does not seem to 
> be working.
> 
> However, if in my code I call the setContent method of NSTreeController 
> passing in the array then it works.  So I know I can do it programmatically - 
> but I was wondering why it's not working when I try it through interface 
> builder.
> 
> Thanks,
> Mazen Abdel-Rahman
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> 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: nstableview text selection

2009-11-23 Thread Richard
thank you jens, that is most helpful, i will take a look at the webview.

On Sun, Nov 22, 2009 at 6:47 PM, Jens Alfke  wrote:

>
> On Nov 22, 2009, at 2:06 AM, Richard wrote:
>
> > as part of an application i am working on, i have made a chat client in
> the
> > style of ichat with pics and bubbles and such. i am currently doing this
> > using an NSTableView
>
> This works, but you'll find it difficult to handle multi-line messages.
> NSTableView can have variable row heights these days, but whenever the view
> width changes you'd have to scan every message counting the number of line
> breaks and set the row's height accordingly.
>
> > now, i would like to be able to select and copy sections of the text
> > displayed in each chat bubble, but i am unable to work out how to do
> this. i
> > would also like to be able to make text links clickable. i understand
> that
> > NSTextView has both these capabilities, but am i correct in thinking that
> > you cannot have an NSView in an NSCell?
>
> That's basically correct. The reason is that the cell doesn't have a
> specific position in the view; it's used to draw every single row; but a
> view has to have a single position. There are some workarounds for this but
> they involve adding a subview for every row, which doesn't scale well.
>
> The way iChat worked originally was to use a single NSTextView for the
> whole chat, with a paragraph per message, and draw a custom background that
> looked up the layout bounds of each paragraph to find the bounding box of
> its balloon. This sounds simple, but the details got very messy, and I don't
> recommend it.
>
> These days the best way is to use a WebView and a custom CSS stylesheet.
> Make each message a  element with a particular class, and the
> stylesheet describes the background and border. WebKit supports some
> nonstandard CSS border attributes that make it easy to draw the border by
> tiling a single image. You use the DOM API to insert a  when there's a
> new message.
>
> —Jens
>
>
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


drawRect method not called after several hours...

2009-11-23 Thread Boris Prohaska
Hi guys... this is a tricky one. 

My application is intended to run for serveal hours/days/weeks. It does GUI 
updates multiple times a second. But after several hours/days the drawRect: 
method is stopped beeing called on _all_ views. The application still does what 
it is supposed to do, but the GUI simply does not draw, but it's functioning 
well. When i resize the window then, then all the drawing wakes up, but only 
for the time, when i drag the window. Then it stopps drawing again. All 
"setNeedsDisplay:" methods are being called, but no drawRect method. This 
happens on both 10.5.X and 10.6.2

All screen savers are disabled, all energy saving mechanisms off.

Does anyone know what's the problem here?

Thanks
Boris ___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


change value for key in NSDictionary

2009-11-23 Thread Ariel Feinerman
Hi,
there is instance of NSDictionary to storage graphics attributes (full
screen, buffers` sizes, resolution),
my question is can I change value for, example, key "fullscreen"
somewhere in my progam?

{
NSArray *key = [NSArray arrayWithObject: @"fullscreen"];
NSArray *values = [NSArray arrayWithObject: [NSNumber numberWithBool: NO]];
NSDictionary *dic = [[NSDictionary alloc] initWithObjects: values
forKeys: keys]];
thing = [[OpenGL alloc] initWithFrame: [win frame] attribute: dic];


[dic release];
}

- (id) initWithFrame: (NSRect) frame attribute: (NSDictionary *) attribute {

/ * some code */
_attribute = [NSDictionary dictionaryWithDictionary: attribute];

return self
}

{
// get
BOOL fstate = [[_attribute valueForKey: @"fullscreen"] boolValue];
// change
?
}

methods dictionaryWithDictionary:, initWithDictionary: return
safe-changed copy or just retain them?

--
best regards
Ariel
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: drawRect method not called after several hours...

2009-11-23 Thread Mike Abdullah
Sounds to me like an exception occurred at some point and upset the drawing 
mechanism (think I've seen something similar before, but not over a long time 
period). Getting in the logs to suggest an exception?

Mike.

On 23 Nov 2009, at 12:30, Boris Prohaska wrote:

> Hi guys... this is a tricky one. 
> 
> My application is intended to run for serveal hours/days/weeks. It does GUI 
> updates multiple times a second. But after several hours/days the drawRect: 
> method is stopped beeing called on _all_ views. The application still does 
> what it is supposed to do, but the GUI simply does not draw, but it's 
> functioning well. When i resize the window then, then all the drawing wakes 
> up, but only for the time, when i drag the window. Then it stopps drawing 
> again. All "setNeedsDisplay:" methods are being called, but no drawRect 
> method. This happens on both 10.5.X and 10.6.2
> 
> All screen savers are disabled, all energy saving mechanisms off.
> 
> Does anyone know what's the problem here?
> 
> Thanks
> Boris ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> 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


Locale based font

2009-11-23 Thread Symadept
Hi,

I found out the way to show custom font.

1. First give information in info.plist, under the identifier, Application
fonts resource path.
2. Add this file into the Resources folder.
3. Invoke using this method. [NSFont fontWithName:CP_FONT_NAME size:11],
NSFontAttributeName,

Works fine. But what I want is to use this font file only in english locale
and in other locales it should fallback to the system fonts of the
corresponding controls.

Any pointers highly appreciable.

Regards
Mustafa
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Strings mangled on generalPasteboard

2009-11-23 Thread Kevin Walzer



I'm writing a tool that wants to make NSString data available after a 
drag operation to the general clipboard: the idea is to extract the data 
from the draggingPasteboard and then write the string data to the 
generalClipboard.


If the dragtype is NSString or NSURL, this works as expected. The same 
data that is dragged comes out intact on the clipboard. However, file 
paths are inexplicably converted to file URL's, so that instead of 
"/Users/kevin/Desktop/foo.txt," I get 
"file://localhost/Users/kevin/Desktop/foo.txt." I want to retain the 
path string instead of it being converted to a URL, and since I can't 
find a convenient method to convert file URL's back to simple path 
strings, I'm a bit stuck.


Additionally, when I drag several files to the drag destination, only a 
single file URL is returned. Given that my code converts the array of 
file names to a single NSString separated by tabs via 
componentsJoinedByString, this is especially unexpected. When I see this 
output from NSLog in the drag data:


/Users/kevin/tk85-patched/htmlwidget-hv.diff 
/Users/kevin/tk85-patched/htmlwidget-new.diff 
/Users/kevin/tk85-patched/htmlwidget.diff 
/Users/kevin/tk85-patched/htmlwidget.tar.bz2.tar


I get this output from the general clipboard:

file://localhost/Users/kevin/tk85-patched/htmlwidget.tar.bz2.tar

My performDragOperation code is below. Any advice is appreciated.


- (BOOL)performDragOperation:(id )sender {

  //  NSArray types;

  dragpasteboard = [sender draggingPasteboard];

  //retrieve string data from clipboard
  NSArray *types = [dragpasteboard types];
  NSString *pasteboardvalue = nil;
  for (NSString *type in types) {
//string type
if ([type isEqualToString:NSStringPboardType]) {
  pasteboardvalue = [dragpasteboard stringForType:NSStringPboardType];
  //URL; convert to string
} else if ([type isEqualToString:NSURLPboardType]) {
  pasteboardvalue =  [[NSURL URLFromPasteboard:dragpasteboard] 
absoluteString];

  //file array, convert to string
} else if ([type isEqualToString:NSFilenamesPboardType]) {

  NSArray *files = [dragpasteboard 
propertyListForType:NSFilenamesPboardType];

  NSString *filename;
  filename =  [files componentsJoinedByString:@"\t"];
  pasteboardvalue = filename;
  NSLog(pasteboardvalue);
}
  //get the string from the drag pasteboard to the general pasteboard
  NSPasteboard *generalpasteboard = [NSPasteboard generalPasteboard];
  NSArray *pasteboardtypes = [NSArray 
arrayWithObjects:NSStringPboardType, nil];

  [generalpasteboard declareTypes:pasteboardtypes owner:self];
  [generalpasteboard setString:pasteboardvalue forType:NSStringPboardType];
  }
  return YES;
}

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.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: change value for key in NSDictionary

2009-11-23 Thread Klaus Backert


On 23 Nov 2009, at 13:33, Ariel Feinerman wrote:


Hi,
there is instance of NSDictionary to storage graphics attributes (full
screen, buffers` sizes, resolution),
my question is can I change value for, example, key "fullscreen"
somewhere in my progam?


From the NSDictionary Class Reference:

"An instance of NSDictionary is an immutable dictionary: you establish  
its entries when it’s created and cannot modify them afterward. An  
instance of NSMutableDictionary is a mutable dictionary: you can add  
or delete entries at any time, and the object automatically allocates  
memory as needed."


Use an NSMutableDictionary and invoke e.g.

[myMutableDictionary setObject: [NSNumber numberWithBool: fstate]  
forKey: @"fullscreen"];


This replaces a previous entry with the same key.

Regards
Klaus

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: drawRect method not called after several hours...

2009-11-23 Thread Boris Prohaska
Hi Mike, no there is no exception raised. The interesting thing is that when i 
touch the frozen window in the lower right hand corner and resize the view... 
the drawing works; but only for the time i resize it. The application works 
perfectly in the backend. It seems that some system is not called or prevents a 
call to drawRect. Maybe i should call "display" or "displayIfNeeded"?

Boris

Am 23.11.2009 um 13:55 schrieb Mike Abdullah:

> Sounds to me like an exception occurred at some point and upset the drawing 
> mechanism (think I've seen something similar before, but not over a long time 
> period). Getting in the logs to suggest an exception?
> 
> Mike.
> 
> On 23 Nov 2009, at 12:30, Boris Prohaska wrote:
> 
>> Hi guys... this is a tricky one. 
>> 
>> My application is intended to run for serveal hours/days/weeks. It does GUI 
>> updates multiple times a second. But after several hours/days the drawRect: 
>> method is stopped beeing called on _all_ views. The application still does 
>> what it is supposed to do, but the GUI simply does not draw, but it's 
>> functioning well. When i resize the window then, then all the drawing wakes 
>> up, but only for the time, when i drag the window. Then it stopps drawing 
>> again. All "setNeedsDisplay:" methods are being called, but no drawRect 
>> method. This happens on both 10.5.X and 10.6.2
>> 
>> All screen savers are disabled, all energy saving mechanisms off.
>> 
>> Does anyone know what's the problem here?
>> 
>> Thanks
>> Boris ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> 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: Locale based font

2009-11-23 Thread Ricky Sharp
I am about to play around with something similar. In my iPhone app, I  
have some calls with boldSystemFontOfSize. But, for certain locales,  
it should be a plain font and the size may need to be tweaked.


I then had an idea to write a static method to obtain a font style and  
size based on locale. My thought was to come up with a key for each  
"style" and then have a localized property list file to store the  
styles for each locale.


Kinda like how you often have a CSS file for each locale your web site  
is localized to.


Sent from my iPhone

On Nov 23, 2009, at 7:00 AM, Symadept  wrote:


Hi,

I found out the way to show custom font.

1. First give information in info.plist, under the identifier,  
Application

fonts resource path.
2. Add this file into the Resources folder.
3. Invoke using this method. [NSFont fontWithName:CP_FONT_NAME size: 
11],

NSFontAttributeName,

Works fine. But what I want is to use this font file only in english  
locale

and in other locales it should fallback to the system fonts of the
corresponding controls.

Any pointers highly appreciable.

Regards
Mustafa
___

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

Please do not post admin requests or moderator comments to the list.
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


How can I not block hotkey from other apps

2009-11-23 Thread Symadept
Hi,

I managed to get my app support for registering hotkeys and using it. But
unfortunately if I register Cmd P as hot key in my app, no one in the system
can use this hotkey to print unless I deregister it. How can I make it not
block others.

Any pointers highly appreciable.

Target: Tiger, Leopard, Snow leopard
Reference: Carbons' RegisterEventHotKey

Regards
Mustafa
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Transparency Help

2009-11-23 Thread R T
I have a litho image (black & white pixels only) and I want to make all the 
white pixels transparent. I am using Quartz 2d to display the image and I have 
a Quartz composition containing a single .cikernel...

kernel vec4 whiteToTransparent(sampler source_image) 
{ 
   
vec4 pixValue;
pixValue = sample(source_image, samplerCoord(source_image));
return  (pixValue == vec4(1,1,1,1) ? vec4(1,1,1,0) : vec4(pixValue));
}

it doesn't seem to work. Here is what I have...

- (void)drawRect:(NSRect)rect {
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
NSString* imagePath =  [[NSBundle mainBundle] pathForResource:@"Richards Thres 
1 of 7" ofType:@"tif"];
NSImage *theImage = [[[NSImage alloc] 
initByReferencingFile:imagePath]autorelease];
[selfMyDrawTransparencyLayer:context:rect.size.width:rect.size.height:theImage];
}

- (void) MyDrawTransparencyLayer: (CGContextRef)myContext: (float)wd: 
(float)ht: (NSImage *)addThisImage//1 
{ 
[selfsetKeyCGImageRef:[selfCGImageRefFromNSImage:addThisImage]];
CGRect rect = CGRectMake(0, 0, CGImageGetWidth(keyCGImageRef), 
CGImageGetHeight(keyCGImageRef));
keyCGImageRef = ApplyWhiteToTransparentComposition([@"whiteToTransparent" 
UTF8String], keyCGImageRef);
CGContextBeginTransparencyLayer (myContext, NULL);
CGContextDrawImage (myContext, rect, keyCGImageRef);
CGContextEndTransparencyLayer (myContext);
}

- (CGImageRef) CGImageRefFromNSImage:(NSImage*)anImage
{ 
CFDataRef imgData = (CFDataRef)[anImage TIFFRepresentation];
CGImageSourceRef imageSourceRef = CGImageSourceCreateWithData(imgData, NULL);
return  CGImageSourceCreateImageAtIndex(imageSourceRef, 0, NULL);
}

CGImageRef ApplyWhiteToTransparentComposition(const char* compositionName, 
const CGImageRef srcImage)
{
CGImageRef resultImage = NULL;
NSAutoreleasePool* pool = [NSAutoreleasePool new];
NSString* compName = [NSString stringWithCString:compositionName];
NSString* compositionPath =  [[NSBundle mainBundle] pathForResource:compName 
ofType:@"qtz"];
NSOpenGLPixelFormatAttribute attributes[] = {NSOpenGLPFAAccelerated, 
NSOpenGLPFANoRecovery, (NSOpenGLPixelFormatAttribute)0};
NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] 
initWithAttributes:attributes];
NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:format 
shareContext:nil];
@try
  {
   QCRenderer* renderer = [[QCRenderer alloc] initWithOpenGLContext:context 
pixelFormat:format file:compositionPath];
  [renderer setValue:(id)srcImage forInputKey:@"source_image"];
  [renderer renderAtTime:0.0 arguments:nil];
  NSImage* image = [renderer valueForOutputKey:@"output_image"];
  
  if (image)
{
CFDataRef imgData = (CFDataRef)[image TIFFRepresentation];
CGImageSourceRef imageSourceRef = CGImageSourceCreateWithData(imgData, NULL);
resultImage = CGImageSourceCreateImageAtIndex(imageSourceRef, 0, NULL);
}
  [renderer release];
  }
@catch(id exception)
  {
  NSLog(@"Error running Quartz Composition '%s': %@", compositionName, 
exception);
  }
// Done, clean up
[context release];
[format release];
[pool release];
return resultImage;
}

Any ideas?

Thanks
Rick


  
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


NIB/XIB created objects, should they be released in -[dealloc]?

2009-11-23 Thread Michael A. Crawford
I wouldn't have though so.  I would assume that since I did not allocate them 
directly, I don't need to clean them up.  I've just inspected some code that 
declares properties that are marked as outlets and whose member variables are 
allocated in the NIB file.  When the class' dealloc method is called, it calls 
release for said properties.

I would assume this is bad form.  But I would like to know if I'm mistaken and 
if this is valid.

@interface ViewController : UIViewController
{
MKMapView* mapView;
}
@property (nonatomic, retain) IBOutlet MKMapView* mapView;
@end

@implementation ViewController

@synthesize mapView;

- (void)dealloc
{
[mapView release], mapView = nil;
[super dealloc];
}
@end

-Michael

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NIB/XIB created objects, should they be released in -[dealloc]?

2009-11-23 Thread Sherm Pendley
On Mon, Nov 23, 2009 at 11:13 AM, Michael A. Crawford
 wrote:
> I wouldn't have though so.  I would assume that since I did not allocate them 
> directly, I don't need to clean them up. I've just inspected some code that 
> declares properties that are marked as outlets and whose member variables are 
> allocated in the NIB file.  When the class' dealloc method is called, it 
> calls release for said properties.
>
> I would assume this is bad form.  But I would like to know if I'm mistaken 
> and if this is valid.

It's valid. Remember the other part of the memory management rule -
because you send them a -retain message, you're required to balance
that by sending them a -release when you're done with them.

> @property (nonatomic, retain) IBOutlet MKMapView* mapView;

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.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: NIB/XIB created objects, should they be released in -[dealloc]?

2009-11-23 Thread Dave Camp
On Nov 23, 2009, at 8:13 AM, Michael A. Crawford wrote:

> I wouldn't have though so.  I would assume that since I did not allocate them 
> directly, I don't need to clean them up.  I've just inspected some code that 
> declares properties that are marked as outlets and whose member variables are 
> allocated in the NIB file.  When the class' dealloc method is called, it 
> calls release for said properties.
> 
> I would assume this is bad form.  But I would like to know if I'm mistaken 
> and if this is valid.

Actually, that is correct. The retain/release rules for nibs are documented at 
http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/1051i-CH4-SW6

Note that they are different for Mac OS X and iPhone.

Dave


___

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

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

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

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


Re: Transparency Help

2009-11-23 Thread glenn andreas

On Nov 23, 2009, at 10:12 AM, R T wrote:

> I have a litho image (black & white pixels only) and I want to make all the 
> white pixels transparent. I am using Quartz 2d to display the image and I 
> have a Quartz composition containing a single .cikernel...

> Any ideas?
> 

Why not just draw it using one of the transfer modes like kCGBlendModeDarken or 
kCGBlendModeMultiply rather than generate multiple images, tweaking all their 
bits, custom kernels, etc...

Both modes should cause black pixels to be drawn as black, and white pixels to 
not change the image at all...


Glenn Andreas  gandr...@gandreas.com 
The most merciful thing in the world ... is the inability of the human mind to 
correlate all its contents - HPL

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSStream Operation Timed out issue

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 12:02 AM, Ramesh P wrote:

> I have an cocoa application which used to transfer files to server
> using the NSStream SSL Socket connection.
> For every successful file transaction server will send a response to
> my application. This is working fine for small files. But when i
> transfer big files my application throwing an error after 75 seconds
> and the socket connection also closed.

Didn't you already post this exact question last week?
Also, this would be more appropriate on the macnetworkprog list.

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 not block hotkey from other apps

2009-11-23 Thread Bill Cheeseman

On Nov 23, 2009, at 10:17 AM, Symadept wrote:

> I managed to get my app support for registering hotkeys and using it. But
> unfortunately if I register Cmd P as hot key in my app, no one in the system
> can use this hotkey to print unless I deregister it. How can I make it not
> block others.

I do it in my hotkey callback function by temporarily unregistering my hotkey, 
reposting the incoming keyboard event into the event stream, and re-registering 
my hotkey. It works fine.


--

Bill Cheeseman
b...@cheeseman.name

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 5:06 AM, Kevin Walzer wrote:

> If the dragtype is NSString or NSURL, this works as expected. The same data 
> that is dragged comes out intact on the clipboard. However, file paths are 
> inexplicably converted to file URL's, so that instead of 
> "/Users/kevin/Desktop/foo.txt," I get 
> "file://localhost/Users/kevin/Desktop/foo.txt."

I think that's because the code snippet you posted checks for URLs on the 
pasteboard before checking for file paths. When a file is on the pasteboard, 
both data flavors are present, and you're preferring to get the URL.

>  I can't find a convenient method to convert file URL's back to simple path 
> strings

-[NSURL path]

> Additionally, when I drag several files to the drag destination, only a 
> single file URL is returned.

Again, you're checking for the URL flavor before the filenames flavor. Reverse 
the order of these tests.

The Cocoa Pasteboard API has the annoying limitation that there is no standard, 
public data type for multiple URLs. The de facto type is 
@"WebURLsWithTitlesPboardType" which is used by WebKit and Safari, but isn't 
declared in a header anywhere.

A useful tool when dealing with pasteboard integration issues like these is 
PasteboardPeeker — it's Apple sample code that you can download and build. It's 
a simple app with a window that you can drag stuff into, and it will dump all 
of the data types on the pasteboard and their (partial) contents.

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 5:06 AM, Kevin Walzer wrote:

> If the dragtype is NSString or NSURL, this works as expected. The same data 
> that is dragged comes out intact on the clipboard. However, file paths are 
> inexplicably converted to file URL's, so that instead of 
> "/Users/kevin/Desktop/foo.txt," I get 
> "file://localhost/Users/kevin/Desktop/foo.txt."

I think that's because the code snippet you posted checks for URLs on the 
pasteboard before checking for file paths. When a file is on the pasteboard, 
both data flavors are present, and you're preferring to get the URL.

>  I can't find a convenient method to convert file URL's back to simple path 
> strings

-[NSURL path]

> Additionally, when I drag several files to the drag destination, only a 
> single file URL is returned.

Again, you're checking for the URL flavor before the filenames flavor. Reverse 
the order of these tests.

The Cocoa Pasteboard API has the annoying limitation that there is no standard, 
public data type for multiple URLs. The de facto type is 
@"WebURLsWithTitlesPboardType" which is used by WebKit and Safari, but isn't 
declared in a header anywhere.

A useful tool when dealing with pasteboard integration issues like these is 
PasteboardPeeker — it's Apple sample code that you can download and build. It's 
a simple app with a window that you can drag stuff into, and it will dump all 
of the data types on the pasteboard and their (partial) contents.

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: mySQL client lib linking problem...

2009-11-23 Thread Nick Zitzmann

On Nov 23, 2009, at 12:32 AM, Michael Davey wrote:

> As an aside I have the 64bit PPC version as well - does anyone know if this 
> is needed?

Only if you're planning on making a PPC64 version of your app. Otherwise, it's 
a waste of space. The PPC64 architecture never did get a whole lot of love from 
developers or users, because it was never turned on by default, the PPC64 
frameworks had a lot of problems early on that were later fixed, and it was 
discontinued in Snow Leopard...

Nick Zitzmann


___

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

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

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

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


CATransition for whole windows?

2009-11-23 Thread PCWiz
CATransition can be used to animate views, but is there a way to  
animate complete windows (NSWindow's or NSPanel's)?


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: CATransition for whole windows?

2009-11-23 Thread Kyle Sluder

On Nov 23, 2009, at 9:32 AM, PCWiz  wrote:

CATransition can be used to animate views, but is there a way to  
animate complete windows (NSWindow's or NSPanel's)?


It depends on what you mean. You have the animator proxy, of course,  
which can do opacity and frame changes. Changes to subviews of the  
window's content view can be animated in Core Animation just like any  
other. Windows themselves can't be Done with Core Animation, but  
NSAnimation would work for your purposes. Though I don't see what you  
could want to do that the animator proxy doesn't already take care of  
for you.


--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: CATransition for whole windows?

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 9:32 AM, PCWiz wrote:

> CATransition can be used to animate views, but is there a way to animate 
> complete windows (NSWindow's or NSPanel's)?

If you're just talking about animating movement/resize, you can do that with 
-setFrame:display:animate: or using the NSAnimatablePropertyContainer protocol 
that NSWindow implements.

If you mean funky distortion/transform effects on windows, I don't believe 
there is any public API. Internally the WindowServer supports arbitrary mesh 
deformations for windows, but the API for that is private; it's only used for 
things like the Dock's "genie effect".

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


Transparency Help 2

2009-11-23 Thread R T
Given: A litho Image, Black & White pixels only. 
I want to show just the Black Pixels in a subclassed NSView.

 I've posted previously with some code and had 1 simple response that has not 
panned out for me. Any ideas out there, anybody been down this road?

Thanks
Rick


  
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CATransition for whole windows?

2009-11-23 Thread Matt Neuburg
On Mon, 23 Nov 2009 10:32:24 -0700, PCWiz  said:
>CATransition can be used to animate views, but is there a way to
>animate complete windows (NSWindow's or NSPanel's)?

Animate *what* about a complete window? If you mean what's *in* the window,
that *is* a view (the window's contentView). If you mean make the window
dance around the screen somehow, please don't. ) m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


[OT] Re: A question of legality...

2009-11-23 Thread Alastair Houghton
On 23 Nov 2009, at 10:58, Michael Davey wrote:

> I want to share with you all the 4 arch version of the mysql libs that I went 
> to some trouble to make today, but in light of the information given to me 
> today by Andrew Farmer, I do not know if this is legal.
> 
> Anyone know?

This isn't really a Cocoa question, right?  So why cocoa-dev?  There are other, 
better places for this discussion.

That said, my understanding (though I am not a lawyer) is that the MySQL 
libraries are under GPL and that there is an exception for FLOSS software.  
They are *not* subject to the LGPL, and so you can't link to them from a 
commercial or shareware program without being in breach of the GPL (doing so 
makes your program a "Derivative Work" and therefore you would have to release 
the source code).

If you distribute binary copies, you must comply with the GPL requirement to 
make the sources that you used available.  If you haven't changed anything, you 
could just give the URL for the official sources; if you have changed 
something, you could do that and provide a patch.

I'll also add that it's illegal in some jurisdictions to give legal advice 
unless one is a qualified lawyer, so you're unlikely to get good answers to 
legal questions on a mailing list.  You should consult a lawyer if you're at 
all unclear.

Kind regards,

Alastair.

-- 
http://alastairs-place.net



___

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

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

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

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


Re: Strings mangled on generalPasteboard

2009-11-23 Thread mmalc Crawford

On Nov 23, 2009, at 8:54 am, Jens Alfke wrote:

> The Cocoa Pasteboard API has the annoying limitation that there is no 
> standard, public data type for multiple URLs.
> 
This is no longer true with Mac OS X v10.6 and later -- you can write and read 
multiple URLs to and from to the pasteboard.

e.g.
[url pasteboardPropertyListForType:(NSString *)kUTTypeURL]
and
NSArray *newURLs = [pasteboard readObjectsForClasses:
[NSArray arrayWithObject:[NSURL class]]
   options:[NSDictionary dictionary]];

mmalc

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CATransition for whole windows?

2009-11-23 Thread PCWiz
What I had in mind was a window vanishing effect for when the window  
is closed (for example a fade out is easy to do with [[window  
animator] setAlphaValue:0.0];) but something slightly more complex,  
such as the private "suckEffect" transition that CATransition offers.


On 2009-11-23, at 11:02 AM, Matt Neuburg wrote:

On Mon, 23 Nov 2009 10:32:24 -0700, PCWiz   
said:

CATransition can be used to animate views, but is there a way to
animate complete windows (NSWindow's or NSPanel's)?


Animate *what* about a complete window? If you mean what's *in* the  
window,
that *is* a view (the window's contentView). If you mean make the  
window

dance around the screen somehow, please don't. ) m.

--
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings





___

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

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

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

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


ANN: CamelBones 1.1.0

2009-11-23 Thread Sherm Pendley
Now supporting Leopard and Snow Leopard, and more. Read the full
announcement at:



sherm--

-- 
Cocoa programming in Perl: http://camelbones.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


Re: Best approach to write an uninstaller for osx

2009-11-23 Thread Kyle Sluder
On Sat, Nov 21, 2009 at 4:50 PM, Jens Alfke  wrote:
> Sure, you can do that. As I said, there's no particular trick for deleting 
> the uninstaller. The filesystem won't stop you from deleting your own binary 
> (or moving it to the trash.)

The filesystem doesn't care, but the OS sure as heck does.  Launch
Services and CoreServices both freak out if a running app goes
bye-bye—to the Trash or anywhere else.

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

2009-11-23 Thread Greg Guerin

R T wrote:


kernel vec4 whiteToTransparent(sampler source_image)
{

vec4 pixValue;
pixValue = sample(source_image, samplerCoord(source_image));
return  (pixValue == vec4(1,1,1,1) ? vec4(1,1,1,0) : vec4(pixValue));
}


I'm ignorant of GL shading, but something looks wrong here.  If  
pixValue's type is vec4, then why is the third expression vec4 
(pixValue), instead of just pixValue?


The other thing that comes to mind is you're testing for an exact  
match (== vec4(1,1,1,1)) in order to return white with transparent  
alpha (vec4(1,1,1,0)).  Are you sure the result of sample() is  
exact?  Instead of testing exactly for white, maybe you can test for  
not black.


  -- GG

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Best approach to write an uninstaller for osx

2009-11-23 Thread James Walker

Kyle Sluder wrote:

On Sat, Nov 21, 2009 at 4:50 PM, Jens Alfke  wrote:

Sure, you can do that. As I said, there's no particular trick for deleting the 
uninstaller. The filesystem won't stop you from deleting your own binary (or 
moving it to the trash.)


The filesystem doesn't care, but the OS sure as heck does.  Launch
Services and CoreServices both freak out if a running app goes
bye-bye—to the Trash or anywhere else.


Could you define "freak out" in this context?  I haven't noticed any 
problem with moving a running app to the trash just before quitting it.


--
  James W. Walker, Innoventive Software LLC
  
___

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

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

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

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


Re: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 10:30 AM, mmalc Crawford wrote:

> This is no longer true with Mac OS X v10.6 and later -- you can write and 
> read multiple URLs to and from to the pasteboard.

That's nice to know.

> e.g.
>[url pasteboardPropertyListForType:(NSString *)kUTTypeURL]

But that still only writes a single NSURL, right? How do you write multiple 
using that API?

Another area where WebKit's undocumented pasteboard type is still superior is 
that it associates names with the URLs — so if the user drags bookmarks out of 
Safari into your app, you get the titles of the bookmarks as well as the URLs. 
This is useful for apps like Yojimbo, etc. that want to be able to store 
dragged-in URLs in mnemonic form.

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: CATransition for whole windows?

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 10:33 AM, PCWiz wrote:

> What I had in mind was a window vanishing effect for when the window is 
> closed (for example a fade out is easy to do with [[window animator] 
> setAlphaValue:0.0];) but something slightly more complex, such as the private 
> "suckEffect" transition that CATransition offers.

Yeah, private API only. File a bug report to request that it be made public; 
there are all kinds of cool eye-candy things that API could be used for — 
flipping windows over, perspective effects, crumpling them up, curling their 
corners like a document icon...

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Strings mangled on generalPasteboard

2009-11-23 Thread Kyle Sluder
On Mon, Nov 23, 2009 at 1:04 PM, Jens Alfke  wrote:
> But that still only writes a single NSURL, right? How do you write multiple 
> using that API?

I highly recommend watching the WWDC09 session on this topic, if for
no other reason than for the song.

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

2009-11-23 Thread Kyle Sluder
On Mon, Nov 23, 2009 at 8:12 AM, R T  wrote:
> I have a litho image (black & white pixels only) and I want to make all the 
> white pixels transparent. I am using Quartz 2d to display the image and I 
> have a Quartz composition containing a single .cikernel...

This is more appropriate to the quartz-dev list.

I agree with Glenn, you shouldn't need to involve Core Image for this.
 It sounds like you could use a Quartz image mask.

--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: Best approach to write an uninstaller for osx

2009-11-23 Thread Nick Zitzmann

On Nov 23, 2009, at 2:02 PM, James Walker wrote:

> Could you define "freak out" in this context?  I haven't noticed any problem 
> with moving a running app to the trash just before quitting it.

If you move a running application, then NSBundle will return the old & obsolete 
paths for bundle resources, which may or may not be significant depending on 
what your app has to do just before it quits. At least this was as of Leopard. 
I haven't checked this under Snow Leopard.

Nick Zitzmann


___

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

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

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

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


Re: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 1:23 PM, Kyle Sluder wrote:

>> But that still only writes a single NSURL, right? How do you write multiple 
>> using that API?
> 
> I highly recommend watching the WWDC09 session on this topic, if for
> no other reason than for the song.

A song about new Pasteboard APIs?! That I've gotta see.
I hope it was by They Might Be Giants, MC Frontalot, or "Weird" Al Yancovic...

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: drawRect method not called after several hours...

2009-11-23 Thread Alexander Spohr

Am 23.11.2009 um 13:30 schrieb Boris Prohaska:

> It does GUI updates multiple times a second.

How?

atze

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: [OT] Re: A question of legality...

2009-11-23 Thread Jean-Daniel Dupas

Le 23 nov. 2009 à 19:10, Alastair Houghton a écrit :

> On 23 Nov 2009, at 10:58, Michael Davey wrote:
> 
>> I want to share with you all the 4 arch version of the mysql libs that I 
>> went to some trouble to make today, but in light of the information given to 
>> me today by Andrew Farmer, I do not know if this is legal.
>> 
>> Anyone know?
> 
> This isn't really a Cocoa question, right?  So why cocoa-dev?  There are 
> other, better places for this discussion.
> 
> That said, my understanding (though I am not a lawyer) is that the MySQL 
> libraries are under GPL and that there is an exception for FLOSS software.  
> They are *not* subject to the LGPL, and so you can't link to them from a 
> commercial or shareware program without being in breach of the GPL (doing so 
> makes your program a "Derivative Work" and therefore you would have to 
> release the source code).
> 
> If you distribute binary copies, you must comply with the GPL requirement to 
> make the sources that you used available.  If you haven't changed anything, 
> you could just give the URL for the official sources; if you have changed 
> something, you could do that and provide a patch.
> 
> I'll also add that it's illegal in some jurisdictions to give legal advice 
> unless one is a qualified lawyer, so you're unlikely to get good answers to 
> legal questions on a mailing list.  You should consult a lawyer if you're at 
> all unclear.
> 
> Kind regards,
> 
> Alastair.
> 
> -- 

Note that Apple already distribute a binary version of Mysql with the darwin 
sources.

Search for mysql on this page:

http://opensource.apple.com/release/mac-os-x-1061/


-- Jean-Daniel




___

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

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

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

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


Re: Transparency Help 2

2009-11-23 Thread Alexander Spohr
Am 23.11.2009 um 19:01 schrieb R T:

> Given: A litho Image, Black & White pixels only. 
> I want to show just the Black Pixels in a subclassed NSView.

Underlay all white pixel with an alpha of 0 and composite that?

atze

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Strings mangled on generalPasteboard

2009-11-23 Thread mmalc Crawford

On Nov 23, 2009, at 1:04 pm, Jens Alfke wrote:

>>   [url pasteboardPropertyListForType:(NSString *)kUTTypeURL]
> 
> But that still only writes a single NSURL, right? How do you write multiple 
> using that API?
> 
On Mac OS X v10.6 and later, you can write multiple items to a pasteboard, so 
you simply write as many URLs as you want.



mmalc
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: WebView in a modal panel - any new solutions?

2009-11-23 Thread Mike Abdullah
WebKit is open source, so fire up your SVN client for release 4.0.3. In 
WebViewPrivate.h you will see this:

@interface WebView (WebPendingPublic)
- (void)scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
- (void)unscheduleFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode;
@end

Which would seem to be exactly what you need. I think these in fact go back to 
version 3.1, but can't be bothered to check right now (4.0.3 is what I have 
checked out locally).

Your choices:

A) Use this API and make sure nothing will go drastically wrong should the 
WebKit team change the API before making it public

B) Ship a custom version of WebKit that you know has these methods with your 
app (although it sounds like in your case this probably isn't feasible)

Somebody will probably shout at me for mentioning "private" API, but WebKit is 
somewhat of a special case thanks to option B. Mind you, this sort of question 
probably would have been better on the WebKit list.

Mike.

On 18 Nov 2009, at 23:21, Leif Harrison wrote:

> Is anyone out there using WebViews in modal panels?  If so, what are you 
> doing to get around it's issues with NSURLConnection? (Presuming it's still 
> an issue in Snow Leopard?  Which it certainly seem like from what I've 
> seen...)
> 
> Our current solution is to use a custom subclass of NSURLConnection and 
> poseAsClass, however this has two BIG issues with it.  1) poseAsClass is 
> deprecated, and 2) this is being done in a plugin, which really makes me feel 
> like we're being a "bad citizen" by replacing a class that might be used by 
> the host application or by other plugins.
> 
> The only other real option I've seen out there is to use 
> beginModalSessionForWindow/runModalSession/endModalSession and execute the 
> default runloop within the modal run loop.
> (http://www.dejal.com/blog/2007/01/cocoa-topics-case-modal-webview)
> 
> Unfortunately, in our case we don't have control of the initial modal session 
> setup (being a plugin) so that isn't a solution we can use.
> 
> So...are there any other workable solutions out there?  Alternatives to 
> poseAsClass that can be undone? Solutions that use the WebView delegate 
> methods? (I'm currently trying this, but we use a lot of interactive 
> Javascript, so I haven't quite gotten it to work yet.)  Other possibilities?
> 
> Or is there some hope of WebView supporting modal sessions/panels sometime 
> soon? (or some API I'm missing...?)
> 
>   - Leif
> 
> --
> Leif Harrison
> Senior Engineer - Ubermind, Inc.
> l...@ubermind.com
> rexfe...@catsreach.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/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: Strings mangled on generalPasteboard

2009-11-23 Thread Kevin Walzer

On 11/23/09 11:54 AM, Jens Alfke wrote:


Again, you're checking for the URL flavor before the filenames flavor.
Reverse the order of these tests.



Unfortunately, that didn't seem to help. It appears that URL's take 
precedence over file paths. Removing the URL pasteboard type solved the 
problem.


Given that file paths are a requirement for my project and URL's  are a 
"nice-to-have," I'll have to move forward without NSURL. Too bad.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.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: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 3:51 PM, Kevin Walzer wrote:

> Given that file paths are a requirement for my project and URL's  are a 
> "nice-to-have," I'll have to move forward without NSURL. Too bad.

Why? To get the filesystem path just do
if ([url isFileURL])
path = [url path];

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Strings mangled on generalPasteboard

2009-11-23 Thread Kevin Walzer

On 11/23/09 7:14 PM, Jens Alfke wrote:


On Nov 23, 2009, at 3:51 PM, Kevin Walzer wrote:


Given that file paths are a requirement for my project and URL's  are a 
"nice-to-have," I'll have to move forward without NSURL. Too bad.


Why? To get the filesystem path just do
if ([url isFileURL])
path = [url path];

—Jens



Does this address the problem of only one NSURL being returned? I'm on 
10.5, still, so I can't take advantage of those shiny new API's.


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.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: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 4:16 PM, Kevin Walzer wrote:

> Does this address the problem of only one NSURL being returned?

No. But BTW I looked at your code again and I see why it's failing to get the 
paths.

>  for (NSString *type in types) {
>//string type
>if ([type isEqualToString:NSStringPboardType]) {
>  pasteboardvalue = [dragpasteboard stringForType:NSStringPboardType];
>  //URL; convert to string
>} else if ([type isEqualToString:NSURLPboardType]) {
>  pasteboardvalue =  [[NSURL URLFromPasteboard:dragpasteboard] 
> absoluteString];

You're looping over all the types on the drag pasteboard, and every time you 
stuff your resulting 'pasteboardvalue' string into the general pasteboard. 
Since each iteration overwrites the result of the previous ones, you only end 
up handling the last type on the pasteboard. I'm not sure exactly what your 
code is intending to do, but you need to restructure it somehow.

The thing that tends to make the most sense usually is not to loop but to ask 
the pasteboard for the data for each type you're interested in, the best type 
first, and then use the first type you get. So in your case you'd probably ask 
for filenames first, then URLs, then strings.

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Darren Wheatley

Hi,

I have the following code as the action from a button click:

- (IBAction)chooseFile:(id)sender;
{
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanCreateDirectories:NO];
[openPanel beginSheetForDirectory:nil
 file:nil
types:[NSArray arrayWithObject:@"txt"]
   modalForWindow:window
modalDelegate:self
   
didEndSelector:@selector(fileOpenDidEnd:returnCode:context:)

  contextInfo:nil];
}

- (void)fileOpenDidEnd:(NSOpenPanel*)openPanel
returnCode:(NSInteger)code
   context:(void*)context
{
if (code == NSCancelButton) return;
[self setFilePath:[openPanel filename]];
[filePathField setStringValue:[openPanel filename]];
}

On my 10.6.2 iMac running XCode 3.2.1 it builds and runs fine. On my 
MacBook Pro with exactly the same OS version (10.6.2) and XCode version 
I get a crash - EXC_BAD_ACCESS when I run it.


The file open dialog pops up for a second but then disappears before I 
can click on anything.


The fileOpenDidEnd method does not get called.

Any idea why identical code built with the same version of XCode running 
on the same version of Snow Leopard works on one machine and crashes on 
another? Both are clean builds of Snow Leopard rather than upgrades.


Regards

Darren.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Darren Wheatley
The only difference between the two machines is that the working machine 
has DefaultFolderX installed on it.


As a test I installed Default Folder X on the MBP as well. The code now 
runs without error.


So, why would Default Folder X be masking the problem (it overloads the 
file open/save dialog to add functionality such as favourite folders)?


Cheers

Darren.


On 24/11/2009 00:51, Darren Wheatley wrote:

Hi,

I have the following code as the action from a button click:

- (IBAction)chooseFile:(id)sender;
{
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanCreateDirectories:NO];
[openPanel beginSheetForDirectory:nil
 file:nil
types:[NSArray arrayWithObject:@"txt"]
   modalForWindow:window
modalDelegate:self
   
didEndSelector:@selector(fileOpenDidEnd:returnCode:context:)

  contextInfo:nil];
}

- (void)fileOpenDidEnd:(NSOpenPanel*)openPanel
returnCode:(NSInteger)code
   context:(void*)context
{
if (code == NSCancelButton) return;
[self setFilePath:[openPanel filename]];
[filePathField setStringValue:[openPanel filename]];
}

On my 10.6.2 iMac running XCode 3.2.1 it builds and runs fine. On my 
MacBook Pro with exactly the same OS version (10.6.2) and XCode 
version I get a crash - EXC_BAD_ACCESS when I run it.


The file open dialog pops up for a second but then disappears before I 
can click on anything.


The fileOpenDidEnd method does not get called.

Any idea why identical code built with the same version of XCode 
running on the same version of Snow Leopard works on one machine and 
crashes on another? Both are clean builds of Snow Leopard rather than 
upgrades.


Regards

Darren.


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/darren%40tenjinconsulting.co.uk 



This email sent to dar...@tenjinconsulting.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


Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 4:51 PM, Darren Wheatley wrote:

> On my 10.6.2 iMac running XCode 3.2.1 it builds and runs fine. On my MacBook 
> Pro with exactly the same OS version (10.6.2) and XCode version I get a crash 
> - EXC_BAD_ACCESS when I run it.

Just the exception type isn't very useful. You should post a backtrace too.
(The code you posted looks fine.)

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-23 Thread Graham Cox

On 24/11/2009, at 11:51 AM, Darren Wheatley wrote:

> - (IBAction)chooseFile:(id)sender;
> {
>NSOpenPanel *openPanel = [NSOpenPanel openPanel];
>[openPanel setCanChooseDirectories:NO];
>[openPanel setCanCreateDirectories:NO];
>[openPanel beginSheetForDirectory:nil
> file:nil
>types:[NSArray arrayWithObject:@"txt"]
>   modalForWindow:window


What is 'window' and where does it come from? Is it valid?

--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: NSTreeController content array bindings

2009-11-23 Thread Mazen M. Abdel-Rahman
Thanks everyone for your help on this.

Turns out my problem was initializing and adding objects to my array to late in 
the process - I was doing it in the windowDidLoad function - by which time the 
bindings have already happened - and since I was add objects to the array by 
just using the addObject function the NSTreeController was not being informed 
of the changes.  When I moved the array initializing to the init function 
everything worked.

Thanks,
Mazen

On Nov 23, 2009, at 4:37 AM, Mike Abdullah wrote:

> http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/Troubleshooting.html#//apple_ref/doc/uid/TP40002148
> 
> Don't bind to an NSMutableArray. Bind to an array property of an object.
> 
> On 23 Nov 2009, at 03:20, Mazen M. Abdel-Rahman wrote:
> 
>> Hi All,
>> 
>> I am having trouble binding an NSTreeController's content array to an 
>> NSMutableArray through interface builder.
>> 
>> In the bindings inspector of Interface Builder I bind to file's owner - 
>> which in my case is a subclass of NSWindowController, and set the model key 
>> path the the name of the NSMutableArray I want to bind to.  This does not 
>> seem to be working.
>> 
>> However, if in my code I call the setContent method of NSTreeController 
>> passing in the array then it works.  So I know I can do it programmatically 
>> - but I was wondering why it's not working when I try it through interface 
>> builder.
>> 
>> Thanks,
>> Mazen Abdel-Rahman
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> 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


mySQL libs and an apology...

2009-11-23 Thread Michael Davey
First off, sorry to those who I have offended by asking the question of whether 
or not I can share my libs legally to this list. It was not my intention to do 
that.

What I end up distributing with my application is still being considered, and I 
hope to resolve that before I approach my clients with my application - as far 
as I have seen (from router companies at least) is that only the work that is 
open source needs to be shared and not your entire application.

Anyway, that is OT, and I will leave that there as a matter for myself.

What I do want to share is this, the 4 architecture mysql client libraries that 
really should be distributed with the downloaded binaries:

http://www.4shared.com/file/157776724/f48387d3/libmysqlclient_r16.html

To comply with the licence I also supply the source tarball:

http://www.4shared.com/file/158401438/b943a20e/mysql-5141tar.html

However, to create the library itself I merely downloaded the 4 binary 
distributions for each of the architectures from this page:

http://dev.mysql.com/downloads/mysql/5.1.html

I then extracted the tarballs into one folder and used the following lipo 
command to create the universal binary:

lipo mysql-5.1.40-osx10.5-powerpc/lib/libmysqlclient_r.16.dylib 
mysql-5.1.40-osx10.5-powerpc-64bit/lib/libmysqlclient_r.16.dylib 
mysql-5.1.41-osx10.5-x86_64/lib/libmysqlclient_r.16.dylib 
mysql-5.1.41-osx10.5-x86l/lib/libmysqlclient_r.16.dylib -create -output 
libmysqlclient_r.16.dylib 

It was discussed that the PPC64 architecture is a waste of space as it is not 
widely used, so if you wish you could probably make this again yourself and 
skip that part entirely.

As you can also see, I have only made the thread-safe versions of the library, 
I need that myself and am guyessing that is most usefulk to the list as well, 
however, you could follow the same procedure yourselves to make the normal 
version of the libraries.

Again, sorry for the OT part of my discussion, I hope that the libraries I have 
supplied are of use to someone...

Mikey___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Locale based font

2009-11-23 Thread Symadept
Hi Ricky,

Thank you very much for your response. But can we have any way where I can
find current locale is English, I mean all versions of English. This could
solve my issue.

Regards
Mustafa


On Mon, Nov 23, 2009 at 9:50 PM, Ricky Sharp  wrote:

> I am about to play around with something similar. In my iPhone app, I have
> some calls with boldSystemFontOfSize. But, for certain locales, it should be
> a plain font and the size may need to be tweaked.
>
> I then had an idea to write a static method to obtain a font style and size
> based on locale. My thought was to come up with a key for each "style" and
> then have a localized property list file to store the styles for each
> locale.
>
> Kinda like how you often have a CSS file for each locale your web site is
> localized to.
>
> Sent from my iPhone
>
>
> On Nov 23, 2009, at 7:00 AM, Symadept  wrote:
>
>  Hi,
>>
>> I found out the way to show custom font.
>>
>> 1. First give information in info.plist, under the identifier, Application
>> fonts resource path.
>> 2. Add this file into the Resources folder.
>> 3. Invoke using this method. [NSFont fontWithName:CP_FONT_NAME size:11],
>> NSFontAttributeName,
>>
>> Works fine. But what I want is to use this font file only in english
>> locale
>> and in other locales it should fallback to the system fonts of the
>> corresponding controls.
>>
>> Any pointers highly appreciable.
>>
>> Regards
>> Mustafa
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> 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


Build target question

2009-11-23 Thread Michael Davey
I am about to add a new target to my project as it will be re-using a lot of 
the code generated from my server application and I do not want to start 
creating duplicate copies of classes that I am writing.  So far, so good, I am 
finding my way around making my new target, but have a quick question about 
sharing...

Is it possible for me to use the same main.m Prefix.pch and Info.plist file in 
both of my applications or will that muck things up?

regards,

Mikey___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Strings mangled on generalPasteboard

2009-11-23 Thread Kevin Walzer

On 11/23/09 7:26 PM, Jens Alfke wrote:



You're looping over all the types on the drag pasteboard, and every time you 
stuff your resulting 'pasteboardvalue' string into the general pasteboard. 
Since each iteration overwrites the result of the previous ones, you only end 
up handling the last type on the pasteboard. I'm not sure exactly what your 
code is intending to do, but you need to restructure it somehow.

The thing that tends to make the most sense usually is not to loop but to ask 
the pasteboard for the data for each type you're interested in, the best type 
first, and then use the first type you get. So in your case you'd probably ask 
for filenames first, then URLs, then strings.


Basically, what I'm trying to do is implement basic drag support for a 
cross-platform GUI library that runs on top of Cocoa (Tk). My approach 
is retrieve string data from the drag pasteboard (either a raw string, 
an array of file paths, or, if it can be done simply, a URL like 
"http://www.apple.com";) and dump it to the general clipboard, where it 
will be available to Tk. Because of the somewhat generic intent of this 
library, I need to support strings and file paths at a minimum.  NSURL, 
unfortunately, complicates this design more than I would like.


--Kevin
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.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: Transparency Help 2

2009-11-23 Thread BravoBug Software
Here is a method that applies 'mask' based on a given NSColor. ie, you
pass it an NSImage, a NSColor (in your case, white), and a threshold,
and it will make transparent all the pixels of that color within a
threshold. So you can use this to knock out the white pixels of an
NSImage.

Then, of course, just draw that new NSImage into your view using
NSCompositeSourceOver.

(PS: This was thrown together pretty quickly so you may need to tweak
it if it doesn't suit your purposes, but you can at the least perhaps
use it as a jumping off point)

-(NSImage*)calcMaskForColor:(NSColor*)c :(int)threshold :(NSImage*)img
{
NSBitmapImageRep *imageData = [NSBitmapImageRep imageRepWithData:
[img TIFFRepresentation]];
int i=0;
int w = [imageData pixelsWide];
int h = [imageData pixelsHigh];
int numPixels = w * h;
unsigned char *data = [imageData bitmapData];
unsigned char vals[4];
unsigned char col[3];
//assumes nscolor passed has r/g/b components
//ie, dont just pass [NSColor whiteColor]
col[0] = [c redComponent]*255;
col[1] = [c greenComponent]*255;
col[2] = [c blueComponent]*255;
int dif;
//assumes RGBA
for(i=0;i<(numPixels*4);i+=4)
{
memcpy(vals, data+i, 4);
//custom alpha check, you can remove or modify:
if(vals[3] > 240)
{
//visible pixel, check color
dif = 0;
dif += abs(vals[0] - col[0]);
dif += abs(vals[1] - col[1]);
dif += abs(vals[2] - col[2]);
if(dif < threshold)
{
memset(data + i, 0, 4);
}

}   
}
NSImage *newImg = [[[NSImage alloc] initWithSize: NSMakeSize(w,h)]
autorelease];
[newImg addRepresentation: imageData];
return newImg;
}


-matt



On Mon, Nov 23, 2009 at 10:01 AM, R T  wrote:
> Given: A litho Image, Black & White pixels only.
> I want to show just the Black Pixels in a subclassed NSView.
>
>  I've posted previously with some code and had 1 simple response that has not 
> panned out for me. Any ideas out there, anybody been down this road?
>
> Thanks
> Rick
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/bravobug%40gmail.com
>
> This email sent to bravo...@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: Build target question

2009-11-23 Thread Karolis Ramanauskas
Perhaps not quite what you need but I am working on code for iPhone and OSX
in parallel and I am using one main.m, one Prefix.pch. I believe you will
need several info.plist files because target specific stuff lives in them,
this is easy though because you point to info.plist from the target info
panel's build tab.

You may need to find a way to separate what part of prefix.pch or main.m is
meant for which target. I am doing this with:

#if TARGET_OS_IPHONE

you may need some other #if statements or may not, since you are not
building for a different platform.

Karolis

On Mon, Nov 23, 2009 at 7:51 PM, Michael Davey  wrote:

> I am about to add a new target to my project as it will be re-using a lot
> of the code generated from my server application and I do not want to start
> creating duplicate copies of classes that I am writing.  So far, so good, I
> am finding my way around making my new target, but have a quick question
> about sharing...
>
> Is it possible for me to use the same main.m Prefix.pch and Info.plist file
> in both of my applications or will that muck things up?
>
> regards,
>
> Mikey___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/karolisr%40gmail.com
>
> This email sent to karol...@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: Build target question

2009-11-23 Thread Michael Davey
Thanks!

On 24 Nov 2009, at 14:02, Karolis Ramanauskas wrote:

> Perhaps not quite what you need but I am working on code for iPhone and OSX 
> in parallel and I am using one main.m, one Prefix.pch. I believe you will 
> need several info.plist files because target specific stuff lives in them, 
> this is easy though because you point to info.plist from the target info 
> panel's build tab.
> 
> You may need to find a way to separate what part of prefix.pch or main.m is 
> meant for which target. I am doing this with:
> 
> #if TARGET_OS_IPHONE
> 
> you may need some other #if statements or may not, since you are not building 
> for a different platform.
> 
> Karolis
> 
> On Mon, Nov 23, 2009 at 7:51 PM, Michael Davey  wrote:
> I am about to add a new target to my project as it will be re-using a lot of 
> the code generated from my server application and I do not want to start 
> creating duplicate copies of classes that I am writing.  So far, so good, I 
> am finding my way around making my new target, but have a quick question 
> about sharing...
> 
> Is it possible for me to use the same main.m Prefix.pch and Info.plist file 
> in both of my applications or will that muck things up?
> 
> regards,
> 
> Mikey___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/karolisr%40gmail.com
> 
> This email sent to karol...@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: Build target question

2009-11-23 Thread Kyle Sluder
Your question is more appropriate for the Xcode-users list, and asking  
there might generate more response.


--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: Strings mangled on generalPasteboard

2009-11-23 Thread Jens Alfke

On Nov 23, 2009, at 5:54 PM, Kevin Walzer wrote:

> Basically, what I'm trying to do is implement basic drag support for a 
> cross-platform GUI library that runs on top of Cocoa (Tk). My approach is 
> retrieve string data from the drag pasteboard (either a raw string, an array 
> of file paths, or, if it can be done simply, a URL like 
> "http://www.apple.com";) and dump it to the general clipboard, where it will 
> be available to Tk. Because of the somewhat generic intent of this library, I 
> need to support strings and file paths at a minimum.  NSURL, unfortunately, 
> complicates this design more than I would like.

To be frank, the reason URLs aren't working is simply because your code has a 
bug, as I explained in my last message. It could easily be rewritten to do what 
you want to do. This has nothing to do with NSURL.

What you want is something like
if there are files on the pasteboard
store the file path(s)
else if there are URLs
store the URLs
else if there are strings
store the strings

—Jens___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTableView retain count problem

2009-11-23 Thread Shane
> There are two self's, I.e. two different instances.  The name 'self' isn't a
> single variable.  It represents the object that's responding to the message,
> and executing the method.
>
> My guess is that one instance is created in the nib, and the other is
> created in code you wrote.
>
> Use the debugger.  Set a breakpoint on the init methods and look at how it
> reaches that point.

I'm still trying to hunt down the second instance of 'self' that I'm
seeing but I don't understand something here.

@interface AppController : NSWindowController
{
MainViewController *mvc;
NSMutableArray *mainViewControllers;
}
…

@implementation AppController
- (id) init
{
...
mainViewControllers = [[NSMutableArray alloc] init];

// This is the 1st and should be only instance I create.

mvc = [[DataViewController alloc] initWithController:self];
[mainViewControllers addObject:mvc];
[mvc release];
...
}

- (void) awakeFromNib
{
[self displayViewController:[mainViewControllers objectAtIndex:0]];
}

- (void) displayViewController:(MainViewController *) mvc
{
NSWindow *win = [box window];
BOOL ended = [win makeFirstResponder:win];

if (!ended) {
NSBeep();

return;
}

// This is calling the 2nd instance which I can see w/ the debugger.
NSView *mv = [mvc view];

[box setContentView:mv];
}
@end

When I'm viewing the call stack in the debugger, I see that my
DataViewController's init method is called a second time from the line
… "NSView *mv = [mvc view]".

I'm doing view swapping just as is done in Hillegass's 3rd. ed. book.
So my DataViewController is subclassed from a MainViewController which
is an NSViewController.

I looked at the NSViewController docs but didn't anything about why
[NSViewController view] would send an init msg to the receiver.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTableView retain count problem

2009-11-23 Thread Kyle Sluder
On Mon, Nov 23, 2009 at 7:43 PM, Shane
 wrote:
>        // This is the 1st and should be only instance I create.

No, it's not, as evidenced by...

> When I'm viewing the call stack in the debugger, I see that my
> DataViewController's init method is called a second time from the line
> … "NSView *mv = [mvc view]".

You've created an instance in your nib, *and* you're creating one in
code.  Specifically, you've got an instance of DataViewControlller
hanging out in the nib that DataViewController is configured to load.
Calling -view results in that nib being loaded, and your second
DataViewController instance unfrozen.

The only place you want DataViewController to live in that nib file is
as the class of File's Owner.

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


Problem on NSPopUpButton Class

2009-11-23 Thread charisse napeÿfffff1as
Hello,

Is there a known problem with subclassing an NSPopUpButton class in Snow 
Leopard 10.6.2 ?

Problem:  subclassed popup button cannot be disabled sometimes.
Scenario: Instead of using NSPopUpButton directly, I created a subclass of 
NSPopUpButton named MyPopUpButton because there are other things I needed
done in that subclass.
Declaring my popup button as MyPopUpButton, the problem occurs but declaring it 
as an NSPopUpButton the problem doesn't occur.
This is not reproducible in Leopard. Any thoughts?

I am using an Intel iMac machine by the way.



Thanks,
Charisse



  New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
___

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

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

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

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


[iphone] UITableViewCell set cell attributes based on indexPath.row number

2009-11-23 Thread Philip Vallone
Hi List,

If I have an UITableViewCell and want to set the cell attributes based on 
indexPath.row number, how could I do this? In the below example, the cells are 
drawn dynamically and work until the user moves the table. When the first 4 
four rows are redrawn, their font changes. How do I set the first four rows to 
a color and not have it change? 


- (UITableViewCell *)tableView:(UITableView *)tableView 
cellForRowAtIndexPath:(NSIndexPath *)indexPath {

   
NSLog(@"Painting Row Number %d",indexPath.row);

static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView 
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {

cell = [[[UITableViewCell alloc] 
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] 
autorelease];

}

[cell.textLabel setText:[tableList objectAtIndex:indexPath.row]];   
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];

cell.textLabel.font = [UIFont systemFontOfSize:14];
cell.textLabel.numberOfLines = 2;

if (indexPath.row > 3) {

cell.textLabel.textColor = [UIColor redColor];  

}


return cell;
}

Thanks,

Phil___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: UI Question: Hide application window after minimising

2009-11-23 Thread Kyle Sluder
> On 21 Nov 2009, at 10:09, Michael Davey wrote:
> My application only has one window, so this dicussion is a bit moot, but I 
> see your point.
>
>> What this sounds like is that the application hides itself when one of its 
>> windows is miniaturized. ([NSApp hide: nil] when a window's delegate 
>> receives windowDidMiniaturize:)
>
> This does indeed sound like what I want to do - I guess what I need to know 
> now is how to set a delegate for a window and how to capture events (will try 
> looking for that myself first)

Apps that have one window either stay open or quit themselves when
that window is closed.  Printers are an example of the former, and
System Preferences is an example of the latter.

> My application is a long running, almost server like application, and the 
> window only really serves the purpose of starting/stopping certain services.  
> Once they are running, having the window visible may actually be a problem as 
> services could be stopped accidentally.

You should consider splitting your server-esque functionality off into
a separate agent, and offering your user interface in the form of a
normal application, an LSUIElement with a status item, or a System
Preference pane.  There are certain predefined interactions:

1. A "control panel" app can be launched and quit at whim without
affecting the background task.  The user would launch your application
to start or stop the services, and most likely quit it immediately
after they made their change.  If you can only ever have one window
open (ex., System Preferences), closing it quits the application.  If
you can have multiple windows open (ex., Server Admin), the
application behaves like a document-based application in that closing
all open windows does not quit the application, and clicking the
application's dock icon when it is not the active application and has
no windows open causes a new window to open.  Do not use the second
model to present multiple windows on the same configuration to the
user; only use it if each window controls a different set of services
(for example, "services running on my computer" vs. "services running
on foo.example.com").

2. An LSUIElement which has no dock icon or menu bar of its own, but
instead is interacted with only through a status item (the
black-and-white icons in the upper right of the screen).  This
LSUIElement would preferably start at login and stay there throughout
the user's session; it should be far enough out of the way that it
doesn't bother them.  You can combine this model with the control
panel or System Preferences pane model, much like how the Airport menu
has an item to open Network Preferences.

3. A standard System Preference pane.  This app behaves correctly
according to "control panel" app model, except you don't have to do
any of that work.  A System Preferences pane is more appropriate if
the user changes your settings infrequently (ex., a web server running
on a dedicated web host).  A "control panel" app is more appropriate
if the user starts and stops your service relatively frequently (ex.,
a web server used as a development environment by a programmer).

A little bit more information about what your services do would be
helpful in pinpointing the best (most consistent and Mac-like)
interaction model.

--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: Problem on NSPopUpButton Class

2009-11-23 Thread Kyle Sluder
On Mon, Nov 23, 2009 at 1:27 AM, charisse napeÿf1as
 wrote:
> Problem:  subclassed popup button cannot be disabled sometimes.
> Scenario: Instead of using NSPopUpButton directly, I created a subclass of 
> NSPopUpButton named MyPopUpButton because there are other things I needed
> done in that subclass.

You need to describe and post the code for the "other things" you did
in your subclass.

--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: [iphone] UITableViewCell set cell attributes based on indexPath.row number

2009-11-23 Thread Brian Slick
The stuff outside of the if (cell == nil) block will be performed on each cell, 
whether new or reused.  You need to assume that the current display of the cell 
is "wrong", and do what is necessary to make it right.

In this case, if one of your red cells gets reused for rows 0-3, there is 
nothing here defining what the color should be.  So it will remain red.  Add an 
else condition that defines what the color should be for rows 0-3.

Brian


On Nov 23, 2009, at 8:02 PM, Philip Vallone wrote:

> Hi List,
> 
> If I have an UITableViewCell and want to set the cell attributes based on 
> indexPath.row number, how could I do this? In the below example, the cells 
> are drawn dynamically and work until the user moves the table. When the first 
> 4 four rows are redrawn, their font changes. How do I set the first four rows 
> to a color and not have it change? 
> 
> 
> - (UITableViewCell *)tableView:(UITableView *)tableView 
> cellForRowAtIndexPath:(NSIndexPath *)indexPath {
> 
> 
>   NSLog(@"Painting Row Number %d",indexPath.row);
>   
>   static NSString *CellIdentifier = @"Cell";
>   UITableViewCell *cell = [tableView 
> dequeueReusableCellWithIdentifier:CellIdentifier];
>   if (cell == nil) {
> 
>   cell = [[[UITableViewCell alloc] 
> initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] 
> autorelease];
> 
>   }
>   
>   [cell.textLabel setText:[tableList objectAtIndex:indexPath.row]];   
>   [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
>   
>   cell.textLabel.font = [UIFont systemFontOfSize:14];
>   cell.textLabel.numberOfLines = 2;
>   
>   if (indexPath.row > 3) {
>   
>   cell.textLabel.textColor = [UIColor redColor];  
>   
>   }
>   
> 
> return cell;
> }
> 
> Thanks,
> 
> Phil___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/brianslick%40mac.com
> 
> This email sent to briansl...@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: Problem with NSTableView in NSSplitView

2009-11-23 Thread Kyle Sluder
On Sun, Nov 22, 2009 at 11:21 PM, Martin Hewitson
 wrote:
> I'm having some trouble when I have an NSTableView in an NSSplitView. I have 
> the table set in IB to resize with the view it's in (all struts clicked). The 
> table does not fill the full view. I have additionally a button below the 
> table. Both the table and the button are in the top view of the split view. 
> The problem I have is that when the splitter is dragged to the top of the 
> window so that the top view of the split view has zero height, then the 
> splitter is dragged down again to reveal the top view, the table is not in 
> its proper position; the column headers are missing, for example.

This is not an accurate description of your view hierarchy.  It sounds
like you have the following going on:

+ NSSplitView
|--+ Top View (NSView)
|  |--+ NSScrollView
|  |  '-- Table View
|  '-- Button
'-- Bottom View (NSView)

--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: CATransition for whole windows?

2009-11-23 Thread Henry McGilton (Boulevardier)

On Nov 23, 2009, at 10:33 AM, PCWiz wrote:

> What I had in mind was a window vanishing effect for when the window is 
> closed (for example a fade out is easy to do with [[window animator] 
> setAlphaValue:0.0];) but something slightly more complex, such as the private 
> "suckEffect" transition that CATransition offers.
> 
> On 2009-11-23, at 11:02 AM, Matt Neuburg wrote:
> 
>> On Mon, 23 Nov 2009 10:32:24 -0700, PCWiz  said:
>>> CATransition can be used to animate views, but is there a way to
>>> animate complete windows (NSWindow's or NSPanel's)?
>> 
>> Animate *what* about a complete window? If you mean what's *in* the window,
>> that *is* a view (the window's contentView). If you mean make the window
>> dance around the screen somehow, please don't. ) m.


For those interested I've posted a view simple quick and dirty Window
animation that shrinks the window down to effectively zero, and can
then expand it back to its original state.Use the View menu Flip item
to see.

http://www.trilithon.com/download/FlipWindow.zip


Cheers,
. . . . . . . .Henry


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTableView retain count problem

2009-11-23 Thread Shane
> The only place you want DataViewController to live in that nib file is
> as the class of File's Owner.

Thank you. This has cleared up much for me about nibs.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Problem on NSPopUpButton Class

2009-11-23 Thread charisse napeÿfffff1as
Below is my code



#import "MyPopupButton.h"


@implementation MyPopupButton

- (void) awakeFromNib 
{
MyPopupButtonCell *newCell = [[MyPopupButtonCell alloc] init];
[newCell setAction:[[self cell] action]];
[newCell setTarget:[[self cell] target]];
[newCell setControlSize:[[self cell] controlSize]];
[newCell setFont:[[self cell] font]];
[self setCell:newCell];
[newCell release];

[self setAutoenablesItems:NO];
[self initMyPopupButton : 0];

}

#pragma mark - methods -

- (void) initMyPopupButton : (int) selectedItem
{

[self removeAllItems];

NSMenuItem* newMenuItem;

newMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]]
   initWithTitle:@"Item1"
   action:NULL
   keyEquivalent:@""];
[[self menu] addItem:newMenuItem];
[newMenuItem release];

newMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]]
   initWithTitle:@"Item2"
   action:NULL
   keyEquivalent:@""];
[[self menu] addItem:newMenuItem];
[newMenuItem release];

[[self menu] addItem:[NSMenuItem separatorItem]];

newMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]]
   initWithTitle:@"App1"
   action:NULL
   keyEquivalent:@""];
[[self menu] addItem:newMenuItem];
[newMenuItem release];

newMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]]
   initWithTitle:@"App2"
   action:NULL
   keyEquivalent:@""];
[[self menu] addItem:newMenuItem];
[newMenuItem release];

[self selectItemAtIndex : 0];
}


- (void) myListChanged : (NSNotification*) aNotification
{
int selectedIndex = [[aNotification object] intValue];
if (selectedIndex < 0) {
selectedIndex = 0;
} else {
selectedIndex += 3;  
}
[self initMyPopupButton : selectedIndex];
}

- (void) dealloc
{  
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}

@end


@implementation MyPopupButtonCell

#if __LP64__
- (void) selectItemAtIndex : (NSInteger) index
#else
- (void) selectItemAtIndex : (int) index
#endif
{
if (index + 2 <= [self numberOfItems]) {
[super selectItemAtIndex:index];
}
}

@end







From: Kyle Sluder 
To: charisse napeÿf1as 
Cc: cocoa-dev@lists.apple.com
Sent: Tuesday, November 24, 2009 12:54:26
Subject: Re: Problem on NSPopUpButton Class

On Mon, Nov 23, 2009 at 1:27 AM, charisse napeÿf1as
 wrote:
> Problem:  subclassed popup button cannot be disabled sometimes.
> Scenario: Instead of using NSPopUpButton directly, I created a subclass of 
> NSPopUpButton named MyPopUpButton because there are other things I needed
> done in that subclass.

You need to describe and post the code for the "other things" you did
in your subclass.

--Kyle Sluder



  Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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


[Moderator] Re: [OT] Re: A question of legality...

2009-11-23 Thread Scott Anguish

On Nov 23, 2009, at 1:10 PM, Alastair Houghton wrote:

> On 23 Nov 2009, at 10:58, Michael Davey wrote:
> 
>> I want to share with you all the 4 arch version of the mysql libs that I 
>> went to some trouble to make today, but in light of the information given to 
>> me today by Andrew Farmer, I do not know if this is legal.
>> 
>> Anyone know?
> 


Yes, this is off-topic. Please take it anywhere but here.


___

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

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

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

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


Core Data: Specifying latest .mom resource. Was: NSMigratePersistentStoresAutomaticallyOption...

2009-11-23 Thread Jerry Krinock
Sorry, I'm back with this problem.  Although the code I posted worked perfectly 
in a Debug build, when I tested a Release build, the invocation of 
-mergedModelFromBundles: raised this exception :

   Can't merge models with two different entities named 'Ixternalizer_entity'

Apparently if you've got new and old version .mom files in a bundle, of course 
there are going to be conflicts, and it seems that in my Debug build Core Data 
has some way of figuring out which is the latest and merging them.  But in my 
Release build it doesn't work.

So, instead of using -mergedModelFromBundles:, I got the bundle resource path, 
appended the hard-coded .momd path, appended the hard-coded name of the 
*latest* .mom file, created a URL, and then created PSC using 
-initWithContentsOfURL:

I'm not posting the code because it is disgusting.  There must be a trick to 
tell Core Data to "just use the latest mom file".  What is it?

Sincerely,

Jerry Krinock

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Problem on NSPopUpButton Class

2009-11-23 Thread Gregory Weston
charisse wrote:

> Is there a known problem with subclassing an NSPopUpButton class in Snow 
> Leopard 10.6.2 ?
> 
> Problem:  subclassed popup button cannot be disabled sometimes.

Working fine here just now. Has worked fine in the past. I'm going to go out on 
a limb and say there's probably something in your code causing the issue.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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