Re: expose - the algorithm

2008-05-07 Thread Thomas Davie
On 8 May 2008, at 06:04, Jens Alfke wrote: On 7 May '08, at 8:50 PM, John Clayton wrote: Does anyone know of literature or code / algorithms that I can look at to learn about how this is done or which approaches are possible? The good news is that some of the details must be public, since

Re: setting frequency using CoreAudio (like iTunes - Equalizer )

2008-05-07 Thread Graham Cox
Um, maybe a book on audio theory might be a better starting point? Maybe the AUGraphicEQ audio unit would also help you. G. On 8 May 2008, at 4:44 pm, Rajeswar Rao wrote: Hi, I am trying to implement iTunes-Equalizer kind of functionality to my mp3 playback. Can any body direct me how t

Re: Keys dependent on NSArrayController's selection

2008-05-07 Thread Dave Dribin
On May 7, 2008, at 6:58 PM, Sean McBride wrote: Have you put a breakpoint in 'canEnableButton'? When 'peopleController.selectionIndexes' changes, do you hit the breakpoint? I suspect not. Nope. Well, it does get called once at app startup, but not as the selection changes. The docs fo

Re: Threading - How its done?

2008-05-07 Thread Chris Hanson
On May 7, 2008, at 11:20 PM, Michael Vannorsdel wrote: What is sounds like you're saying is something like: const char * str = "Hello"; //thread 1 char bufferA[20]: strncpy(bufferA, str, sizeof(bufferA)); //thread 2 char bufferB[20]: strncpy(bufferB, str, sizeof(bufferB)); is unsafe and need

setting frequency using CoreAudio (like iTunes - Equalizer )

2008-05-07 Thread Rajeswar Rao
Hi, I am trying to implement iTunes-Equalizer kind of functionality to my mp3 playback. Can any body direct me how to do this. I started looking into CoreAudio frameworks. So far I couldn't get how to set the frequency to the Audio. Any help. thanks in Advance raj

Re: Threading - How its done?

2008-05-07 Thread Michael Vannorsdel
What is sounds like you're saying is something like: const char * str = "Hello"; //thread 1 char bufferA[20]: strncpy(bufferA, str, sizeof(bufferA)); //thread 2 char bufferB[20]: strncpy(bufferB, str, sizeof(bufferB)); is unsafe and needs a lock? On May 7, 2008, at 11:26 PM, Chris Hanson wro

Re: Threading - How its done?

2008-05-07 Thread Chris Hanson
On May 6, 2008, at 6:32 PM, Karl von Moller wrote: With regard to Threading PDF's, while I didn't want to specifically build for 10.5 only, using NSOperation's or using some sort of priority queue process - does this offer any protection for threading PDF activities? As yet I have not used

Re: Threading - How its done?

2008-05-07 Thread Chris Hanson
On May 5, 2008, at 10:12 PM, Michael Vannorsdel wrote: Now if two threads are just reading the same piece of data it's ok for them to do so at the same time, I don't know what gave you this idea, but it's simply not correct in the general case. Whether you're accessing or changing shared

Re: NSStream blocking behavior?

2008-05-07 Thread Michael Ash
On Thu, May 8, 2008 at 12:59 AM, Michael Gardner <[EMAIL PROTECTED]> wrote: > Are there any guarantees about blocking behavior for NSInputStream and > NSOutputStream? For example, if I receive an NSStreamEventHasSpaceAvailable > for an NSOutputStream, how many bytes can I write without blocking? It

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread Michael Ash
On Thu, May 8, 2008 at 12:19 AM, David Wilson <[EMAIL PROTECTED]> wrote: > On that note, John suggested sharking in his first response, and your > response to him was "I know what's happening, so I don't think Shark > or Instruments can help any." I would very strongly suggest that this > respo

InstantMessage Framework Question

2008-05-07 Thread Steve Cronin
Folks; I've gotten the IM framework to respond to a few basic things but I'm puzzled by something simple... I can determine the audio or video capabilities of buddies just fine BUT how do I figure out what my own capabilities are? If I send the request for IMPersonCapabilitiesKey for my ow

NSStream blocking behavior?

2008-05-07 Thread Michael Gardner
Are there any guarantees about blocking behavior for NSInputStream and NSOutputStream? For example, if I receive an NSStreamEventHasSpaceAvailable for an NSOutputStream, how many bytes can I write without blocking? It doesn't seem safe to do I/O in the main thread if there are no such guara

[moderator] Re: offtopic: cocoa iphone

2008-05-07 Thread Scott Anguish
On May 7, 2008, at 9:13 PM, Jeremy Pereira wrote: On 7 May 2008, at 14:47, I. Savant wrote: On May 7, 2008, at 9:37 AM, Mike Abdullah wrote: As ever, the iPhone SDK is under the NDA you agreed to. You cannot discuss it **ANYWHERE**. Fixed that for you. ;-) As far as I can tell, the OP

[moderator ]Re: Off Topic: selling a product line

2008-05-07 Thread Scott Anguish
Yes, this is entirely off-topic. anytime you feel you need to put 'offtopic' in the subject, you shouldn't post it here. others have pointed you to other resources. scott moderator On May 7, 2008, at 8:31 PM, Kimo wrote: This is not the usual development question, but this list probably

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread Sherm Pendley
On Thu, May 8, 2008 at 12:19 AM, David Wilson <[EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 11:12 PM, Ben Einstein <[EMAIL PROTECTED]> > wrote: > > John's suggestion of getting rid of strlen was spot on; the code below > works > > extremely well if using [NSData length] a single time before

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread David Wilson
On Wed, May 7, 2008 at 11:12 PM, Ben Einstein <[EMAIL PROTECTED]> wrote: > John's suggestion of getting rid of strlen was spot on; the code below works > extremely well if using [NSData length] a single time before the loop. > > What I'm still curious about is the difference in processing between

Re: Threading - How its done?

2008-05-07 Thread Michael Vannorsdel
This post contains a lot of great info. However just wanted to clear up a common misconception on memory barriers. Unfortunately they're not guaranteed to cause all data in register to be pushed to memory (don't generate store instructions); only when the program executes a store instructi

Re: offtopic: cocoa iphone

2008-05-07 Thread Jens Alfke
On 7 May '08, at 6:13 PM, Jeremy Pereira wrote: There have been dozens of NDA breaking enquiries on this list. Surely that should tell Apple that they are doing something wrong. This is a beta program and it is actually quite difficult to figure out where to post bugs. What is the point

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread Jens Alfke
On 7 May '08, at 5:16 PM, Ben Einstein wrote: I'm using Serge Cohen's MCPKit (aka SMySQL), which has a nifty little function to convert NSData to a MySQL-legal NSString. The "B" in "BLOB" stands for Binary, meaning that you don't have to encode the data in any way; the database should just

Re: expose - the algorithm

2008-05-07 Thread Jens Alfke
On 7 May '08, at 8:50 PM, John Clayton wrote: Does anyone know of literature or code / algorithms that I can look at to learn about how this is done or which approaches are possible? The good news is that some of the details must be public, since this is patented. You can look up the paten

expose - the algorithm

2008-05-07 Thread John Clayton
Hi All, I have a task to move windows around and fit them into a defined space, almost exactly like Expose. I.e. the space to fit all the windows to is defined (i.e. its your display), but I can scale windows in order to make my space allocation more efficient as required. Does anyone kn

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread Ben Einstein
John's suggestion of getting rid of strlen was spot on; the code below works extremely well if using [NSData length] a single time before the loop. What I'm still curious about is the difference in processing between the NSImage and the zip archive. The same code and the same number of by

Re: Off Topic: selling a product line

2008-05-07 Thread Andy Lee
Please disregard. I was confusing this with the list Andrew Merenbach pointed to. Sorry for the noise. --Andy On May 7, 2008, at 8:44 PM, Andy Lee wrote: On May 7, 2008, at 8:31 PM, Kimo wrote: I hope this topic is not too far off-topic. I would say it is pretty far off-topic. Try this

Re: Saving only required files in a file wrapper?

2008-05-07 Thread Ken Thomases
On May 7, 2008, at 9:06 PM, Graham Cox wrote: On 8 May 2008, at 10:26 am, Keith Blount wrote: The trouble with all of these methods is that they tell you not to rely on fileURL My interpretation of that advice is that at the time the read... and write... methods are called, the document h

Re: find repaint areas?

2008-05-07 Thread Denis Bohm
Thanks for the CGWaitForScreen tip. I hadn't seen those and will take a look. Overriding drawRect on a top level view sounds promising also. I had thought about overriding setNeedsDisplay on a top level view in the window, but it wasn't clear that would catch calls to child views. On May

Re: Saving only required files in a file wrapper?

2008-05-07 Thread Graham Cox
On 8 May 2008, at 10:26 am, Keith Blount wrote: The trouble with all of these methods is that they tell you not to rely on fileURL My interpretation of that advice is that at the time the read... and write... methods are called, the document hasn't set up -fileURL, so in that sense you

Palette a NSStepper with tow Buttons and a NSTextField

2008-05-07 Thread 王仕俊
Hi,all I know NSStepper provided by Interface builder. But now I need to setImage like NSButton for a NSStepper, so I use two buttons and a textFiled to make my stepper. and another problem, I need make my stepper as a palette. How should I do? Many thanks __

Re: Avoiding NSAccessibilityException?

2008-05-07 Thread Martin Wierschin
When access for assistive devices is enabled in the system preferences, the exception handler in my application catches bunches of NSAccessibilityExceptions when a panel is opened. Any way to avoid that? You can have your NSExceptionHandler delegate methods ignore accessibility exceptions

Re: Group rotation

2008-05-07 Thread Erik Buck
Regarding flowing text around objects, do you have a function for breaking an arbitrary shape into a series of line rectangles that you'd be prepared to share with the world? http://www.cocoabuilder.com/archive/message/cocoa/2007/2/22/179186 ___ Cocoa

Re: find repaint areas?

2008-05-07 Thread Graham Cox
I asked much the same question a few days ago, the answer would appear to be, you can't get those rects until drawRect: time. But couldn't you send your remote update then anyway? While that would effectively synchronise your remote screen update to the event cycle of the first machine, I d

Re: offtopic: cocoa iphone

2008-05-07 Thread Jeremy Pereira
On 7 May 2008, at 14:47, I. Savant wrote: On May 7, 2008, at 9:37 AM, Mike Abdullah wrote: As ever, the iPhone SDK is under the NDA you agreed to. You cannot discuss it **ANYWHERE**. Fixed that for you. ;-) As far as I can tell, the OP wasn't trying to discuss the iPhone SDK, but mere

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread John Stiles
Um, are you really calling strlen() on a block of data there, on every iteration through the loop? This (a) won't work if the data has null-terminator (zero) bytes in it, and (b) seems crazy slow. NSData has a method to get the number of bytes in the data, use that. So, um, have you verified t

Re: Group rotation

2008-05-07 Thread Graham Cox
I don't think it makes the more classic approach wrong - it's just another way to crack that particular nut, with its own advantages (and probably disadvantages too, like more code, more dependency between classes, possibly lower performance, I don't know - but there's no "one true way" to

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread Ben Einstein
Well, I know what's happening, so I don't think Shark or Instruments can help any. I just don't know WHY it happens. This is the code i've been playing with (from Hayden Stainsby): inti; const char*thumbnailHex; thumbnailHex = [thumbnailDataHex bytes]; f

Where to set values for initWithFrame:..... in my NSMatrix subclass

2008-05-07 Thread P Teeson
Using Mac OS X.4.11, Xcode 2.5 on PPC In my project I have sub-classed both NSMatrix (e.g FooMatrix) and NSButtonCell (e.g. FooButtonCell). The designated initialiser for FooMatrix is -(id)initWithFrame:(NSRect)frameRect mode:(int)aMode cellClass:(Class)classId numberO

stringValue/indexOfSelectedItem in NSComboBox returning wrong values.

2008-05-07 Thread Cameron Hotchkies
Hi all, In an app I'm working on, I need a ComboBox that pulls it's contents from a database. I did this by attaching a datasource. I have the (case insensitive) autocomplete working, everything seemed to be going well. My datasource class implements the following functions: - (id)comboBox:(NSCom

Re: Off Topic: selling a product line

2008-05-07 Thread Andy Lee
On May 7, 2008, at 8:31 PM, Kimo wrote: I hope this topic is not too far off-topic. I would say it is pretty far off-topic. Try this list, where questions very similar to yours have been asked a lot: --Andy ___

Re: Off Topic: selling a product line

2008-05-07 Thread Andrew Merenbach
Hi, Kimo, Although I have no answers that I am able to offer you, I would recommend checking out the "macsb" Yahoo! Group at . I've never used that list myself, but I've seen it recommended here on Cocoa-Dev before, and it sounds like what you may

Off Topic: selling a product line

2008-05-07 Thread Kimo
This is not the usual development question, but this list probably has the best people to answer. Suppose you wrote a cool Mac product, and it's been selling well as shareware for years. Then a larger software development company contacts you and says they want to purchase the entire product

Re: Saving only required files in a file wrapper?

2008-05-07 Thread Keith Blount
Thanks again for the reply. Now I'm thinking that maybe just overriding -writeToURL:ofType:error: may be the way to go. In this method, I should just be able to write any changed files out. I hope. The trouble with all of these methods is that they tell you not to rely on fileURL. But in my si

Re: BLOBs, MySQL, hex. Oh my

2008-05-07 Thread John Stiles
Have you tried running Shark? That might give you some insight as to what's going on. Ben Einstein wrote: Hi All, I have an enterprise DB application that once used DO to move some files around (images and zip files, mostly). After some serious testing and lots of reading, I decided to move

BLOBs, MySQL, hex. Oh my

2008-05-07 Thread Ben Einstein
Hi All, I have an enterprise DB application that once used DO to move some files around (images and zip files, mostly). After some serious testing and lots of reading, I decided to move this to a few different BLOB fields in the database. Despite major warnings from people, I've found tha

Re: Keys dependent on NSArrayController's selection

2008-05-07 Thread Sean McBride
On 5/7/08 6:16 PM, Dave Dribin said: >In Interface Builder I bind the button's "Enabled" to >"MyController.canEnableButton". The implementation for >canEnableButton is this: > >- (BOOL)canEnableButton { > NSArray * selectedPeople = [peopleController selectedObjects]; > if ([selectedPeople

Re: NSArrayController's insert:, where should the new item go?

2008-05-07 Thread Sean McBride
On 5/7/08 10:03 PM, Mike Abdullah said: >On that one, I believe the docs to be wrong. I'd file a bug. Thanks for the confirmation. . I wish the docs were right, that's the behaviour I wanted. :( -- Sean McBride, B. Eng

Keys dependent on NSArrayController's selection

2008-05-07 Thread Dave Dribin
Hi All, I feel like I'm missing something basic here. Say I have a table bound to an array controller. And also say that each item in the array controller is a Person with firstName and lastName properties. Now say, I want to have a button that is only enabled when a Person with last n

Re: -draggingEntered: never gets called [SOLVED]

2008-05-07 Thread Michael Gardner
It turns out that this was caused by manipulating the GUI outside the main thread. Once I realized that and refactored accordingly, the issue went away. No wonder I was having trouble duplicating the symptoms! Thanks to everybody who helped me figure this out. -Michael On May 5, 2008, at

Any way to filter an NSTreeController?

2008-05-07 Thread Jens Alfke
I'm using an NSTreeController bound to an NSBrowser to display a hierarchical data structure in my app. I now find I need to implement filtering, i.e. hiding items at all levels of the hierarchy that don't match some condition. Unfortunately it appears that only NSArrayController supports a -

Re: EventMonitorTarget in Cocoa

2008-05-07 Thread Ken Thomases
On May 7, 2008, at 3:17 PM, Mike wrote: I see this has been asked many times before on this list but there doesn't seem to be a definitive answer: does the CG Event tap work in Cocoa apps or not? If not how can one grab keystrokes from other apps in a Cocoa app? "CG Event tap" and "EventM

Re: Saving only required files in a file wrapper?

2008-05-07 Thread Ken Thomases
Hi, On May 7, 2008, at 3:08 PM, Keith Blount wrote: Many thanks for your response... Sure thing. I'm happy to flail in the dark and guess wildly with the best of them. ;) Hmm, I think you're right. I overrided -saveDocument: because it looked as though -writeToURL: and all of the othe

Re: Multiple controls in a table cell

2008-05-07 Thread j o a r
On May 7, 2008, at 1:46 AM, [EMAIL PROTECTED] wrote: I had independently experimented with a similar hack (adding row views as subviews of the Table) and was about to flesh it out until I came across your pre-baked example. Before I dive too deeply into using it, do you see any problem in

find repaint areas?

2008-05-07 Thread Denis Bohm
I am trying to create a buffered window and get notified whenever areas are repainted so that I can also send those areas over the network to a custom remote bitmap display. I don't want to copy the complete buffered image on each update as that would be much too slow. NSView has getRectsB

Re: 8 Digit random number

2008-05-07 Thread Mr. Gecko
Thanks That worked grate On May 7, 2008, at 4:17 PM, Jean-Daniel Dupas wrote: call srandomdev() before the first call to change the initial state. see man random for all details. Le 7 mai 08 à 23:10, Mr. Gecko a écrit : that is not really random maybe if I had added unix time stamp inside o

Re: 8 Digit random number

2008-05-07 Thread Seth Willits
On May 7, 2008, at 2:02 PM, Jean-Daniel Dupas wrote: Le 7 mai 08 à 22:54, Seth Willits a écrit : On May 7, 2008, at 1:50 PM, Mr. Gecko wrote: Hello I am needing to find out how to do an 8 digit random number in cocoa. If there are no way than I can use random number from 1000 to 99

Re: 8 Digit random number

2008-05-07 Thread Mr. Gecko
I'll try On May 7, 2008, at 4:02 PM, Jean-Daniel Dupas wrote: long value = random() % 1000; ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at co

Re: Getting an array/tree controller to select newly added managed objects

2008-05-07 Thread Sean McBride
On 4/18/08 6:46 PM, Ron Lue-Sang said: >> Consider an app that uses bindings and Core Data. It has a tableview >> bound to an array controller. There is an 'Add' button that creates a >> new entity to be shown in the table. It could be implemented by: >> >> 1) sending add: to the array controll

Re: NSArrayController's insert:, where should the new item go?

2008-05-07 Thread Mike Abdullah
On that one, I believe the docs to be wrong. I'd file a bug. On 7 May 2008, at 17:14, Sean McBride wrote: Hi all, The "Cocoa Bindings Programming Topics" document says of NSArrayController's 'insert:' method: "The insert: method creates a new object using the controller's newObject method, an

Re: 8 Digit random number

2008-05-07 Thread Jean-Daniel Dupas
Le 7 mai 08 à 22:54, Seth Willits a écrit : On May 7, 2008, at 1:50 PM, Mr. Gecko wrote: Hello I am needing to find out how to do an 8 digit random number in cocoa. If there are no way than I can use random number from 1000 to in applescript and receive the retuned value. Us

Re: 8 Digit random number

2008-05-07 Thread Herb Petschauer
My knee jerk response was: (rand() % 9000) + 1000 I like "clamp/wrap" better though :-) 2008/5/7 Seth Willits <[EMAIL PROTECTED]>: > On May 7, 2008, at 1:50 PM, Mr. Gecko wrote: > > Hello I am needing to find out how to do an 8 digit random number in > > cocoa. > > If there are no way t

Re: 8 Digit random number

2008-05-07 Thread Shawn Erickson
On Wed, May 7, 2008 at 1:50 PM, Mr. Gecko <[EMAIL PROTECTED]> wrote: > Hello I am needing to find out how to do an 8 digit random number in cocoa. > If there are no way than I can use random number from 1000 to > in applescript and receive the retuned value.

Re: 8 Digit random number

2008-05-07 Thread Seth Willits
On May 7, 2008, at 1:50 PM, Mr. Gecko wrote: Hello I am needing to find out how to do an 8 digit random number in cocoa. If there are no way than I can use random number from 1000 to in applescript and receive the retuned value. Use rand()? -- Seth Willits ___

8 Digit random number

2008-05-07 Thread Mr. Gecko
Hello I am needing to find out how to do an 8 digit random number in cocoa. If there are no way than I can use random number from 1000 to in applescript and receive the retuned value. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

Re: Group rotation

2008-05-07 Thread Gordon Apple
That is effectively what our renderer object does. Note that we transform the drawing space, not the object. For a group object, it sets the group's transform, then recursively calls the same rendering function for the objects in the group. Each object's transform is then applied within the

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 3:52 PM, Sean McBride wrote: I suspect that back in the NeXTStep days it actually did centre it. But when NeXTStep merged with Mac OS, the behaviour was changed to match the Mac OS behaviour. In Classic Mac OS this position is called the 'alert position'. See for example

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 4:05 PM, Philip Bridson wrote: I am sorry if I have offended you. Sean was more gracious than I was. Let's forget about the whole thing. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin re

Re: How is "Apple + Ctrl + D" implemented?

2008-05-07 Thread Deborah Goldsmith
On Apr 28, 2008, at 5:35 AM, John Joyce wrote: The range of the word is up to you to find and depends on the language. If it is any common language from Europe, your job is a lot easier. You mainly need to work with whitespace and punctuation. If you're working with Japanese, you'll need to

Re: Can't understand what's causing NSRangeException

2008-05-07 Thread Bob Smith
On May 7, 2008, at 8:56 AM, Vinayak Suley wrote: Hi, I'm new to objective-C so this might be elementary for some, but I can't seem to figure out why this is happening. Here's two code samples: ONE: SpectralData* spectrum = [selectedLightSource spectralPowerDistribution]; NSMuta

EventMonitorTarget in Cocoa

2008-05-07 Thread Mike
I see this has been asked many times before on this list but there doesn't seem to be a definitive answer: does the CG Event tap work in Cocoa apps or not? If not how can one grab keystrokes from other apps in a Cocoa app? Thanks, Mike ___ Cocoa-de

Re: How to convert UInt8 array to NSString

2008-05-07 Thread Adam R. Maxwell
On Wednesday, May 07, 2008, at 12:37PM, "Jean-Daniel Dupas" <[EMAIL PROTECTED]> wrote: >What make you think this function assumes an exact encoding ? This >method is not the same than +[NSString >stringWithContentsOfFile:encoding:error:]. > >The method +stringWithContentsOfFile:usedEncoding:

Re: Saving only required files in a file wrapper?

2008-05-07 Thread Keith Blount
Hi Ken, Many thanks for your response... Hmm, I think you're right. I overrided -saveDocument: because it looked as though -writeToURL: and all of the other -write... methods expected you to write all the data at any one time. It's possible for my file packages to run to hundreds of megabytes,

Re: NSWindow Centering Problem

2008-05-07 Thread Philip Bridson
Sean/Andy, I am sorry if I have offended you. I do not wish to cause an argument so please accept my apologies. The reason I put that is because it is not the first time I have had responses like that (and much worse to be fair). I am grateful for any help that I am offered but I just thi

Re: NSWindow Centering Problem

2008-05-07 Thread Jean-Daniel Dupas
AFAK, there is no other method than center to center the window on screen, but doing one that really center the window is not very difficult. @implementation NSWindow (TrueCenter) - (void)trueCenter { NSRect frame = [self frame]; NSRect *screen = [[self screen] frame];

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
Be careful how you treat people who are trying to help you. The question you asked was answered. It's your own fault if you worded it wrong. You should be happy you got lighthearted sarcasm instead of a scolding for not reading the docs. Now that you have pointed out that you *have* read

Re: NSWindow Centering Problem

2008-05-07 Thread Sean McBride
On 5/7/08 8:42 PM, Philip Bridson said: >Ok very funny. Just to clarify that I had already read the >documentation, otherwise I would not even be able to get the window >to display on the screen - but thanks for pointing it out. However, >I probably worded the question wrong, so I will re-phrase

Re: NSWindow Centering Problem

2008-05-07 Thread Gregory Weston
Philip Bridson wrote: Can anyone tell me why when I use [MyWindow center] the window ends up about an inch from the top of the screen? I thought this method is meant to center the window. Is there something I am doing wrong? The documentation for NSWindow>>center explicitly notes that the wi

Re: NSWindow Centering Problem

2008-05-07 Thread Philip Bridson
Ok very funny. Just to clarify that I had already read the documentation, otherwise I would not even be able to get the window to display on the screen - but thanks for pointing it out. However, I probably worded the question wrong, so I will re-phrase it: If by using [MyWindow center] the

Re: How to convert UInt8 array to NSString

2008-05-07 Thread Jean-Daniel Dupas
What make you think this function assumes an exact encoding ? This method is not the same than +[NSString stringWithContentsOfFile:encoding:error:]. The method +stringWithContentsOfFile:usedEncoding:error: returns the sniffed encoding by reference using the second argument. At least that'

Re: NSWindow Centering Problem

2008-05-07 Thread Sean McBride
On 5/7/08 3:06 PM, Andy Lee said: >On May 7, 2008, at 2:59 PM, Philip Bridson wrote: >> Can anyone tell me why when I use [MyWindow center] the window ends >> up about an inch from the top of the screen? I thought this method >> is meant to center the window. Is there something I am doing wrong? >

Re: How to convert UInt8 array to NSString

2008-05-07 Thread Gary L. Wade
No, that's not the same thing. The method you suggest assumes an exact encoding; the sniffer functions from TextEncodingConverter look at the data to see if it follows the patterns appropriate for a suggested set of encodings and lets you know which one would be the best match. Typically, such

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 3:06 PM, Andy Lee wrote: center Sets the receiver’s location to the center of the screen. - (void)center Discussion The receiver is placed exactly in the center horizontally and somewhat above center vertically. [...] In fairness, I think it's easy to stop reading after

Avoiding NSAccessibilityException?

2008-05-07 Thread Gerd Knops
When access for assistive devices is enabled in the system preferences, the exception handler in my application catches bunches of NSAccessibilityExceptions when a panel is opened. Any way to avoid that? Thanks Gerd ___ Cocoa-dev mailing list (C

Re: NSWindow Centering Problem

2008-05-07 Thread Jean-Daniel Dupas
Le 7 mai 08 à 20:59, Philip Bridson a écrit : Hi there, Can anyone tell me why when I use [MyWindow center] the window ends up about an inch from the top of the screen? I thought this method is meant to center the window. Is there something I am doing wrong? Many thanks, Phil. Reading

Re: NSNumberFormatter behavior

2008-05-07 Thread Frédéric Testuz
Le 6 mai 08 à 03:29, Chataka a écrit : Hello, My app has a NSTextField on a UI window to accept user input and to display a NSNumber in a model object. The NSTextField and the NSNumber are bound using Cocoa Bindings, and the NSTextField is set a NSNumberFormatter. It is a very simple UI b

Re: NSWindow Centering Problem

2008-05-07 Thread Andy Lee
On May 7, 2008, at 2:59 PM, Philip Bridson wrote: Can anyone tell me why when I use [MyWindow center] the window ends up about an inch from the top of the screen? I thought this method is meant to center the window. Is there something I am doing wrong? Only not reading the documentation. :)

NSWindow Centering Problem

2008-05-07 Thread Philip Bridson
Hi there, Can anyone tell me why when I use [MyWindow center] the window ends up about an inch from the top of the screen? I thought this method is meant to center the window. Is there something I am doing wrong? Many thanks, Phil. ___ Cocoa-dev

Re: How to convert UInt8 array to NSString

2008-05-07 Thread Jean-Daniel Dupas
More modern and more Cocoa way? You mean something like this + [NSString stringWithContentsOfFile:usedEncoding:error:] ;-) «Discussion This method attempts to determine the encoding of the file at path.» Le 7 mai 08 à 19:33, Gary L. Wade a écrit : If you're interested in determining the bes

Re: Group rotation

2008-05-07 Thread Kenny Leung
Hmmm... I'm just talking out loud here, but wouldn't it work to have a group model object whose drawing function is to concatenate its transform to the CTM then tell all the objects within the group to draw? Then all objects inside the group just do their drawing normally. -Kenny On May

Re: how to know a window finishes resizing

2008-05-07 Thread Manfred Schwind
Would you tell me how to know a window finishes resizing? You may want to look at these NSView methods: - (void)viewWillStartLiveResize; - (void)viewDidEndLiveResize; - (BOOL)inLiveResize; Regards, Mani -- http://www.mani.de iVolume - Loudness adjustment for iTunes. LittleSecrets - The encrypt

Re: Threading - How its done?

2008-05-07 Thread Army Research Lab
On 5/7/08 12:34 PM, "Jens Alfke" <[EMAIL PROTECTED]> wrote: > On 7 May '08, at 6:13 AM, Army Research Lab wrote: > >> As for why threads are 'hard'; in reality, they aren't hard, as long >> as >> you are absolutely fastidious in following the rules: > > The same thing could be said of any program

Re: How to convert UInt8 array to NSString

2008-05-07 Thread Gary L. Wade
If you're interested in determining the best encoding match for text, look at the TextEncodingConverter.h header, which has functions related to encoding sniffing. There may be more modern techniques available, but I had used that almost a decade ago in a formerly major web browser. It's not p

Re: self registering NSValueTransformer and bindings

2008-05-07 Thread I. Savant
> I have a self registering NSValueTransformer that requires a binding. Did you mean it's required for use in a binding? > @interface MyValueTransformer : NSValueTransformer { > IBOutlet NSTabView *tabView; > } That's probably not going to work out ... (see below) > // from http://ww

Re: Group rotation

2008-05-07 Thread Gordon Apple
This is a major advantage of separating the drawing (rendering) code from the data model instead of having objects draw themselves (not to mention cross-platform). Our renderer object is recursive (and could be a shared object if not for the deficiencies in shadow rendering -- a story for anot

Re: WebView does not expose bindings in IB 3

2008-05-07 Thread Derek Chesterfield
Yes, but I was showing off to non-Mac-o-philes, so they hadn't seen anything like it before. It was a great way to show off some of the frills of Mac development, even if it is rather contrived [i.e. you'd still need to write code for your web browser eventually!]. But it certainly was a go

Re: Sending an image to Preview to preview the image

2008-05-07 Thread Bill
On May 7, 2008, at 9:46 AM, Ken Thomases wrote: On May 7, 2008, at 10:56 AM, Bill wrote: I'm embarrassed to say that you're correct. What I remembered was a print preview, and it bypassed the regular print window and Preview button. Instead the image went directly to the preview with t

Re: Sending an image to Preview to preview the image

2008-05-07 Thread Ken Thomases
On May 7, 2008, at 10:56 AM, Bill wrote: I'm embarrassed to say that you're correct. What I remembered was a print preview, and it bypassed the regular print window and Preview button. Instead the image went directly to the preview with the Cancel and Print buttons at the bottom. I just

Re: re-read of partition table / diskarbitration probe

2008-05-07 Thread Jens Alfke
On 7 May '08, at 5:13 AM, The SZ wrote: - How can I force a partition table re-read?or- How can I force diskarbitration to probe the hdd again?or- How can I simulate a usb unplug/plugin?or- Something else to notify diskarbitration/finder to mount the hdd? This isn't even remotely a Cocoa

Re: Threading - How its done?

2008-05-07 Thread Jens Alfke
On 7 May '08, at 6:13 AM, Army Research Lab wrote: As for why threads are 'hard'; in reality, they aren't hard, as long as you are absolutely fastidious in following the rules: The same thing could be said of any programming task :) But fastidiously following the rules is itself very hard

Re: WebView does not expose bindings in IB 3

2008-05-07 Thread John Stiles
This was actually in a WWDC WebKit demo when WebKit was first announced—they set up a web browser on stage with no code, IIRC. Derek Chesterfield wrote: I don't think it's a bug. I think Apple just decided they didn't want to expose WebView with all the useful bindings. I used to love that I

NSArrayController's insert:, where should the new item go?

2008-05-07 Thread Sean McBride
Hi all, The "Cocoa Bindings Programming Topics" document says of NSArrayController's 'insert:' method: "The insert: method creates a new object using the controller's newObject method, and inserts it after the current selection." However, it seems to me that the actual behaviour (in 10.5.2) is t

Re: how to know a window finishes resizing

2008-05-07 Thread Jens Alfke
On 7 May '08, at 6:01 AM, Norio wrote: Would you tell me how to know a window finishes resizing? NSView has a bunch of accessors to deal with this, because you sometimes need to customize the way a view redraws to make it not take too much time during a live resize. If you need to get thi

Re: Can't understand what's causing NSRangeException

2008-05-07 Thread Jens Alfke
On 7 May '08, at 8:56 AM, Vinayak Suley wrote: If my understanding of objective-C is correct, the second one is just a short version of writing the first. Yup. But the first one works fine and the second one causes an NSRangeException: That's odd. Something else must be going wrong...

  1   2   >