How to insert not editable text

2008-06-14 Thread Ferhat Ayaz
Hello list, I want to add non editable text parts to an NSTextView. You can add/ drag and delete them within the text view but they should not be editable. This parts will act as placeholders for the actual text. What is the right way to 1. Add this kind of "placeholders" (non editable tex

Re: looking for a crc code

2008-06-14 Thread Ilan Volow
http://www.google.com/search?num=50&hl=en&safe=off&client=safari&rls=en-us&q=crc+cocoa&btnG=Search No mention at all I can find (in the 20 seconds I scanned the first two result pages) of any cocoa CRC implementations. If a newbie were to do a search like this and turned up such a fruitless l

Re: How to insert not editable text

2008-06-14 Thread I. Savant
I guess I have to use the NSMutableAttributedString methods but I could not find in the documentation the attribute names to make a text portion non editable. Hint: This isn't an attribute, it's handled by text system delegate methods. -- I.S.

CoreAnimation removeFromSuperlayer flicker

2008-06-14 Thread Milen Dzhumerov
Hi all, I've got a root layer which has got a solid background and I've got one sublayer. If I call removeFromSuperlayer on the sublayer when the root layer is small in size, it removes itself with animation and there are no problems. But if I increase the size of the window (the hosting

Converting string to encoding

2008-06-14 Thread Dex Morgan
Hello, I need to encode a quoted-printable text and convert it to given encoding according to the headers of a message. I've used some code but the result is wrong. For example =C3=A8 should be 'è' but the result is two symbols (the sqrt symbol and another). I've made these steps: 1) Read t

checkbox in nstableview

2008-06-14 Thread Bart Beulen
Hi, I've got an NSTableView with in the first column filled with checkboxes (NSButtonCell), 2nd and 3rd columns have an NSImage and NSString. The NSImage and NSString column work fine. However, I cannot succeed to set the checkboxes and edit the checkboxes. I'm using this code: -(id)tab

Re: checkbox in nstableview

2008-06-14 Thread Graham Cox
NSInteger (nor BOOL) isn't an object, it's just a scalar value (in fact, an int), so you don't need to retain it - I expect trying to send a message to it for any value other than 0 will crash if it compiles at all. It should work if you just get rid of the retain/ release messages. KVC inte

Re: Converting string to encoding

2008-06-14 Thread Jean-Daniel Dupas
Le 14 juin 08 à 16:43, Dex Morgan a écrit : Hello, I need to encode a quoted-printable text and convert it to given encoding according to the headers of a message. I've used some code but the result is wrong. For example =C3=A8 should be 'è' but the result is two symbols (the sqrt symbol a

Re: converting HTML causes crash

2008-06-14 Thread Jens Alfke
On 13 Jun '08, at 10:58 PM, Rod Schmidt wrote: Yes, that is what's happening, but I am puzzled as to why it only happens when I call initWithData:... or initWithHTML:... and the object it's trying to send a message to has nothing to do with the HTML conversion code. Run with zombies enab

Re: looking for a crc code

2008-06-14 Thread Jens Alfke
On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I can find (in the 20 seconds I scanned the first two result pages) of any cocoa CRC implementations. If a newbie were to do a search like this and turned up such a fruitless list of leads, I wouldn't be surprised in the least

Re: Converting string to encoding

2008-06-14 Thread Ricky Sharp
On Jun 14, 2008, at 9:43 AM, Dex Morgan wrote: I need to encode a quoted-printable text and convert it to given encoding according to the headers of a message. I've used some code but the result is wrong. For example =C3=A8 should be 'è' but the result is two symbols (the sqrt symbol and an

Re: Converting string to encoding

2008-06-14 Thread Jens Alfke
I think the problem is here: [newString appendFormat:@"%c", (char)character]; This interprets the character as Unicode, since NSString is pure Unicode. Then when you ask for the data in ISO-Latin-1, that character gets encoded from Unicode to ISO-Latin-1, which changes its nume

Re: Converting string to encoding

2008-06-14 Thread dexter morgan
What do you think about it? (I've found this in Pantomime framework) http://pastebin.com/m2a8e4df2 So my code become simple: NSData *data = [self decodeQuotedPrintableInHeader: NO]; // self is raw data from file (written in NSISOLatin1) encoded = [[NSString alloc] initWithData: data encoding:fin

Newbie: applescript "call method" to obj-c method (booleans & image data)

2008-06-14 Thread Loren Ryter
Hell all, I'm struggling through learning some basic obj-c to implement some functions that are not supported in applescript, by creating custom obj-c classes and passing parameters to those classes using call methods. Not doing terribly badly, but it's slow going given my level of understanding.

Re: Newbie: applescript "call method" to obj-c method (booleans & image data)

2008-06-14 Thread Graham Cox
On 15 Jun 2008, at 2:08 am, Loren Ryter wrote: WithSticky:(BOOL *)aStick WithClick:(NSString *)aClick BOOL* means "pointer to BOOL" not BOOL itself. So you need to remove the *. The same doesn't apply to NSNumber because NSNumber is an object (objects are always passed by pointer). If yo

Re: Newbie: applescript "call method" to obj-c method (booleans & image data)

2008-06-14 Thread Loren Ryter
On 06/14/08 12:17 PM, "Graham Cox" <[EMAIL PROTECTED]> wrote: > BOOL* means "pointer to BOOL" not BOOL itself. So you need to remove > the *. This worked brilliantly thanks a lot! I literally spent 3 hours on that ;-) > >> iconData:[NSImage initWithContentsOfFile:aPath] > > should be i

Re: looking for a crc code

2008-06-14 Thread Steven Noyes
hi Angelo. This is a trickier question than it sounds. The first thing is you really have to understand is what you are after: 1) do you have an 8 bit, 16 bit or 32 bit CRC? 2) are you constrained to match someone else or is this just for your comms? 3) are you going table driven (recom

Re: Newbie: applescript "call method" to obj-c method (booleans & image data)

2008-06-14 Thread Jean-Daniel Dupas
Le 14 juin 08 à 18:40, Loren Ryter a écrit : On 06/14/08 12:17 PM, "Graham Cox" <[EMAIL PROTECTED]> wrote: BOOL* means "pointer to BOOL" not BOOL itself. So you need to remove the *. This worked brilliantly thanks a lot! I literally spent 3 hours on that ;-) iconData:[NSImage i

Saving Bindings and Editing Font

2008-06-14 Thread Gabriel Shahbazian
Two Questions: 1) I have a table view (single column) and a text view hooked up with bindings to a array controller. How can I get the values inputed by the user in the column and text view and save them then load them on launch? 2) How can I change the font of the text view in the interf

Re: looking for a crc code

2008-06-14 Thread Michael Hall
On Jun 14, 2008, at 10:25 AM, Jens Alfke wrote: On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I can find (in the 20 seconds I scanned the first two result pages) of any cocoa CRC implementations. If a newbie were to do a search like this and turned up such a fruitless l

Re: CoreAnimation removeFromSuperlayer flicker

2008-06-14 Thread Brian Christensen
On Jun 14, 2008, at 10:28 , Milen Dzhumerov wrote: I've got a root layer which has got a solid background and I've got one sublayer. If I call removeFromSuperlayer on the sublayer when the root layer is small in size, it removes itself with animation and there are no problems. But if I incr

Re: How to insert not editable text

2008-06-14 Thread Sherm Pendley
On Sat, Jun 14, 2008 at 9:55 AM, I. Savant <[EMAIL PROTECTED]> wrote: >> I guess I have to use the NSMutableAttributedString methods but I could >> not find in the documentation the attribute names to make a text portion non >> editable. > > Hint: This isn't an attribute, it's handled by text syst

Re: CoreAnimation removeFromSuperlayer flicker

2008-06-14 Thread Milen Dzhumerov
On 14 Jun 2008, at 18:50, Brian Christensen wrote: On Jun 14, 2008, at 10:28 , Milen Dzhumerov wrote: I've got a root layer which has got a solid background and I've got one sublayer. If I call removeFromSuperlayer on the sublayer when the root layer is small in size, it removes itself wit

Re: looking for a crc code

2008-06-14 Thread Andrew Farmer
On 14 Jun 08, at 10:49, Michael Hall wrote: I googled up this one. Might of taken more than a minute I'm afraid. Checksum, Please http://yamacdev.blogspot.com/2006/12/checksum-please.html It suggests zlib which should always be available, shouldn't it? Yep. There was recently a discussion of t

Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-14 Thread Wilhelm Phillips
Hi António, Thanks for the interesting suggestion and link. Using your suggestion, I added this to drawWithBox: in my subclassed PDFPage: NSLog(@"drawing to screen: %@", [[NSGraphicsContext currentContext] isDrawingToScreen] ? @"YES" : @"NO"); Drawing to the screen returns YES. However,

Read PSD-Layers with NSImage

2008-06-14 Thread Boris Prohaska
Hi, I'm totally new to Cocoa and Objective-C, i have read "Cocoa Programming for MAC OS X", it answers a lot, but not everything :-). I searched the documentation, but i can't find any methods which read PSD-Layers. OS X reads psd's natively, so i'm curious where that functions/methods are.

How to create Custom Knobs with Sprite animation ?

2008-06-14 Thread David Paulicke
Hi, i´m new to cocoa and Objective C . ( Blitzmax user ) Is there a way to create custom knobs ? I have one picture ( png ) which contains for example 3 knob frames / positions , and another one with 60 knob frames /positions. How can i display the Animation and use the NSSlider capabilitie

Re: Read PSD-Layers with NSImage

2008-06-14 Thread Kevin Grant
I believe NSImage's initWithContentsOfFile: will open psd files. Kevin G. Hi, I'm totally new to Cocoa and Objective-C, i have read "Cocoa Programming for MAC OS X", it answers a lot, but not everything :-). I searched the documentation, but i can't find any methods which read PSD-Layers.

Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-14 Thread Wilhelm Phillips
Hi Antonio, So I took your suggestion a little further and decided to see if [[NSGraphicsContext currentContext] attibutes] returned anything and it looks like this may do the trick... If the print panel is not cancelled (i.e. print or save to file is clicked) then attributes are returned

NSURLCache - how?

2008-06-14 Thread David Troy
Greetings, Do I need to do anything special to get NSURLCache to be active, like initialize it somehow? I would assume it should be active across the lifespan of an application, and for all NSURLRequests/NSURLConnections. I am using NSURLRequestReturnCacheDataElseLoad and it seems to neve

Re: looking for a crc code

2008-06-14 Thread Michael Hall
--- Andrew Farmer <[EMAIL PROTECTED]> wrote: > > Yep. There was recently a discussion of this on the > list, actually. > Missed that, sorry. > > fprintf(stdout,"crc=%i\n",crc); > > Note that this'll print out the CRC as a signed > integer, which is > almost certainly not what you want

ObjectController and ArrayController tutorials

2008-06-14 Thread Ashley Perrien
Does anyone have any tips on where to get a tutorial or walkthrough explaining controller objects? I've read and done the example in Hillegass' book at least 5 times and read over the Apple docs about bindings and still have a VERY tenuous grasp as to what they (NSObjectController) are, how

NSNotifications & background apps?

2008-06-14 Thread dream cat7
Hi, Seeing notifications from outside: == There was a great logging tool called "Meow" for the nsnotifications but i cannot seem to find that anymore. I had hoped to write a D-Trace probe to give a similar output as "Meow" but support for cocoa objects like NSString

Transparent content view of NSWindow clicks through

2008-06-14 Thread John Joyce
I'm toying with using a transparent content view of an NSWindow. Of course, when you get the background totally transparent, you click in the rect, it clicks through to activate whatever is behind the window. Does anybody know a way to have that much transparency and not click through? I'm s

Re: looking for a crc code

2008-06-14 Thread Tommy Nordgren
On 14 jun 2008, at 19.49, Michael Hall wrote: ...snip #import # include #include int main(int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; unsigned long crc = crc32(0L, Z_NULL, 0); char * test = "TEST"; crc = crc32(crc,test,

Re: ObjectController and ArrayController tutorials

2008-06-14 Thread Erik Buck
Ashley, As it happens, I have written a chapter in "Cocoa Design Patterns" about "why" NSArrayController and friends exist and how to use them. I am interested in feedback on the chapter. Contact me privately if you want to see if we can arrange some way for you to review the chapter.

Re: NSNotifications & background apps?

2008-06-14 Thread Nathan Kinsinger
On Jun 14, 2008, at 1:52 PM, dream cat7 wrote: Hi, Seeing notifications from outside: == There was a great logging tool called "Meow" for the nsnotifications but i cannot seem to find that anymore. I had hoped to write a D- Trace probe to give a similar output as "M

Core Text: Determining Line Height of CTFramesetter

2008-06-14 Thread Milen Dzhumerov
Hi all, I've been looking for ways to draw text in a CALayer and it seems that the new Core Text framework is the best way to do so (it supports 64bit and it's up to twice as fast as ATSUI). But I'm having a bit of trouble determining the height of the text before drawing it (I know the w

Re: Transparent content view of NSWindow clicks through

2008-06-14 Thread Brett Powley
The things I found you have to do to get this working are, for your subclass of NSWindow are: [self setIgnoresMouseEvents:NO]; [self setBackgroundColor:[NSColor clearColor]]; [self setOpaque:NO]; and also override -(BOOL) canBecomeKeyWin

NSSplitview. Stopping the split moving

2008-06-14 Thread Steven Hamilton
Hi folks, I have an NSplitview similar to Mails. I'm trying to fix the split so it doesn't move just like Mail but can't for the life of me figure out how to do it. My left split has an Outlineview and the right split a tableview. Resizing the window always moves the split upsetting the vi

Re: NSSplitview. Stopping the split moving

2008-06-14 Thread Markus Spoettl
On Jun 14, 2008, at 4:15 PM, Steven Hamilton wrote: I have an NSplitview similar to Mails. I'm trying to fix the split so it doesn't move just like Mail but can't for the life of me figure out how to do it. My left split has an Outlineview and the right split a tableview. Resizing the window

Re: NSSplitview. Stopping the split moving

2008-06-14 Thread I. Savant
I have an NSplitview similar to Mails. I'm trying to fix the split so it doesn't move just like Mail but can't for the life of me figure out how to do it. My left split has an Outlineview and the right split a tableview. Resizing the window always moves the split upsetting the visual appear

Re: NSSplitview. Stopping the split moving

2008-06-14 Thread I. Savant
On Jun 14, 2008, at 7:31 PM, Markus Spoettl wrote: The split view prints debug logs when you do something that is completely wrong, so that helps. Well, in Leopard, anyway. -- I.S. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: How to create Custom Knobs with Sprite animation ?

2008-06-14 Thread Graham Cox
Your question doesn't really make any sense. What is a "knob", in the sense you mean it? As png's don't support animation (unlike gif) I also don't understand in what sense you mean animation. Ask a more focused question, and explain your terms. Graham On 15 Jun 2008, at 4:44 am, David P

Re: looking for a crc code

2008-06-14 Thread Michael Vannorsdel
I thought I saw a CRC32 implementation in zlib at one time. On Jun 14, 2008, at 9:25 AM, Jens Alfke wrote: On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I can find (in the 20 seconds I scanned the first two result pages) of any cocoa CRC implementations. If a newbie were

Valid contentObject for NSTreeController (Core Data)

2008-06-14 Thread Daniel Price
Can someone point out the correct method of providing a valid datasource object for the contentObject binding of a NSTreeController in a Core Data document app? I've added an NSManagedObject instance variable to my document subclass (and added an accessor) and bound the controller in a nib

Re: Saving Bindings and Editing Font

2008-06-14 Thread Ken Thomases
On Jun 14, 2008, at 12:16 PM, Gabriel Shahbazian wrote: 1) I have a table view (single column) and a text view hooked up with bindings to a array controller. How can I get the values inputed by the user in the column and text view and save them then load them on launch? The array controll

using NSFileManager to read data

2008-06-14 Thread Angelo Chen
Hi, NSFileManager's contentsAtPath can read the entire file, is there a way to read only a specific bytes? something similar to NSFileHandle's readDataOfLength? thanks, Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.antispam.yahoo.com/ 了解更多相關資訊! __

NSOutlineView threading problem

2008-06-14 Thread David
I'm having various intermittent problems with NSOutlineView which I can only presume is somehow caused by my use of a secondary thread to augment the node tree supplied via a data source. My assumption has been that I'm not doing anything that should cause NSOutlineView a problem. I am strictly ad

Re: Bring app to front

2008-06-14 Thread Adam Gerson
Thanks Andy. Kyle, you make a good point. It dangerious to allow an app to annoy the user. I am building a menu extra that always shows up in the menu bar, but its icon is hidden from the dock and is never consider front by the OS. When these choose an item from my menu it cuases a window to open (

NSTextField "setStringValue" method - deallocates?

2008-06-14 Thread Christopher J Kemsley
I'm new to Obj-C, and I'm trying to make sure I start off writing good code so I don't have to come back and learn how to avoid dirty code and/or memory leaks. That being said, if I do the following: NSString *someString = [ NSString stringWithString:@"Hello World!" ] ; [ someNSTextField se

Re: NSTextField "setStringValue" method - deallocates?

2008-06-14 Thread Michael Vannorsdel
In short yes. The long answer is the textfield will release the string when it's done with it and if no one else retained the string it will be deallocated. On Jun 14, 2008, at 9:35 PM, Christopher J Kemsley wrote: I'm new to Obj-C, and I'm trying to make sure I start off writing good co

Re: NSURLCache - how?

2008-06-14 Thread Jens Alfke
On 14 Jun '08, at 12:09 PM, David Troy wrote: I am using NSURLRequestReturnCacheDataElseLoad and it seems to never return the cached URL and always loads new data from the network. Examine the HTTP response headers for the resources you're loading. There are a number of conditions that wil

Re: NSNotifications & background apps?

2008-06-14 Thread Jens Alfke
On 14 Jun '08, at 12:52 PM, dream cat7 wrote: was also wondering if anyone ever think to encrypt their NSNotification data? If you start getting to that point, you should think about using a real IPC mechanism instead. NSDistributedNotifications are very easy to use, but they're intende

Re: How to create Custom Knobs with Sprite animation ?

2008-06-14 Thread Jens Alfke
On 14 Jun '08, at 11:44 AM, David Paulicke wrote: Is there a way to create custom knobs ? I have one picture ( png ) which contains for example 3 knob frames / positions , and another one with 60 knob frames /positions. How can i display the Animation and use the NSSlider capabilities , t

Re: using NSFileManager to read data

2008-06-14 Thread Jens Alfke
On 14 Jun '08, at 7:05 PM, Angelo Chen wrote: NSFileManager's contentsAtPath can read the entire file, is there a way to read only a specific bytes? something similar to NSFileHandle's readDataOfLength? thanks, Umm... yes, it's NSFileHandle. Just like you said. Or use NSInputStream. Or f

Re: NSOutlineView threading problem

2008-06-14 Thread Jens Alfke
On 14 Jun '08, at 7:19 PM, David wrote: I am using NSMutableArrays to hold the nodes in the tree. One thread is adding child nodes while the main thread maybe accessing the arrays through the data source. I find it hard to imagine that NSMutableArray could be causing the problem. I don'

Re: NSOutlineView threading problem

2008-06-14 Thread Bill Bumgarner
On Jun 14, 2008, at 7:19 PM, David wrote: I am using NSMutableArrays to hold the nodes in the tree. One thread is adding child nodes while the main thread maybe accessing the arrays through the data source. I find it hard to imagine that NSMutableArray could be causing the problem. Neithe

Re: using NSFileManager to read data

2008-06-14 Thread Michael Vannorsdel
NSFileHandle itself. Use seekToFileOffset: and readDataOfLength: to get the bytes you want. Or you can drop down to the BSD layer and use open/close, lseek, and read. On Jun 14, 2008, at 8:05 PM, Angelo Chen wrote: Hi, NSFileManager's contentsAtPath can read the entire file, is there a

Re: NSNotifications & background apps?

2008-06-14 Thread Michael Ash
On Sat, Jun 14, 2008 at 8:56 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 14 Jun '08, at 12:52 PM, dream cat7 wrote: > >> was also wondering if anyone ever think to encrypt their NSNotification >> data? > > If you start getting to that point, you should think about using a real IPC > mechanism

Re: Bring app to front

2008-06-14 Thread Kyle Sluder
On Sat, Jun 14, 2008 at 10:20 PM, Adam Gerson <[EMAIL PROTECTED]> wrote: > When these choose an item from my menu it > cuases a window to open (a window the user wants open and in the > front), but sometimes it appears hidden behind other windows. Thats > why I asked this question. If your menu ex

Re: NSTextField "setStringValue" method - deallocates?

2008-06-14 Thread Kyle Sluder
On Sat, Jun 14, 2008 at 11:35 PM, Christopher J Kemsley <[EMAIL PROTECTED]> wrote: > That being said, if I do the following: > > > NSString *someString = [ NSString stringWithString:@"Hello World!" ] ; > [ someNSTextField setStringValue:someString ] ; > > > Does the NSTextField take care of de-allo

Re: NSOutlineView threading problem

2008-06-14 Thread j o a r
On Jun 14, 2008, at 9:12 PM, Bill Bumgarner wrote: As well, no amount of locking will make a non-thread-safe object thread-safe unless you absolutely positively know that only your code (and only your code protected by the locks) contain the only reference to said object. In the general

Re: creating and using a (Reusable) View xib

2008-06-14 Thread Jerry Isdale
Last week I asked how I could create a view xib + controller and use it in multiple applications (eg. a stand alone test and an app that integrates several of them.) Several people responded to my request last week with some tantalizing leads. The best was Chris Hansen's pointer: This is

Re: Read PSD-Layers with NSImage

2008-06-14 Thread Mike Abdullah
As far as I am aware, Cocoa only supports drawing of PSD images; you can't access the individual layers. To do any more, you probably have to drop down to ImageIO. On 14 Jun 2008, at 11:38, Boris Prohaska wrote: Hi, I'm totally new to Cocoa and Objective-C, i have read "Cocoa Programming f