Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Graham Cox
On 07/02/2010, at 5:19 PM, Trygve Inda wrote: > Would you instantiate the (very simple) NSWindowController subclass > (CheckSheetController) in the nib, or just dynamically create it as needed? > Obviously the window would exist in the nib but TableController could have > an outlet to the window

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Trygve Inda
> > On 07/02/2010, at 5:05 PM, Trygve Inda wrote: > >> I think a sheet would work just as well... In either case the columns will >> not adjust until the use clicks OK. >> >> My thought was to bind the checkboxes to BOOLs in a MutableDict within the >> TableController. Once the sheet is dismisse

Re: Wrong placement with -[NSWindow initWithContentRect:styleMask:backing:defer:screen:]

2010-02-06 Thread Graham Cox
On 06/02/2010, at 9:49 AM, Jack Repenning wrote: > initWithContentRect:NSMakeRect( 928, 1390, > 640, 480 ) [] > With this arrangement, the visibleFrame of the secondary screen is: > - origin.x: -593 > - origin.y: 900 > - size.width: 2560 > - size.height: 1600

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Graham Cox
On 07/02/2010, at 5:05 PM, Trygve Inda wrote: > I think a sheet would work just as well... In either case the columns will > not adjust until the use clicks OK. > > My thought was to bind the checkboxes to BOOLs in a MutableDict within the > TableController. Once the sheet is dismissed, I would

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Trygve Inda
>> So it's window controller would just be a plain NSWindowController (no >> subclass) and in my TableController id just do: >> >> returnCode = [NSApp runModalForWindow:[theWindController window]]; > > It might or might not be a plain NSWindowController. Given the situation you > described, it s

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Graham Cox
On 07/02/2010, at 4:33 PM, Trygve Inda wrote: > I haven't really done a project quite like this before and in the past I > have used a separate nib for each window. A separate nib for every distinct window is a good idea. But often a sheet is an auxiliary to some other more important window -

iPhone: Lost with GK

2010-02-06 Thread Development
I'm trying to send an image in NSData format via bluetooth from one device to another. Below is my code: -(void)sendDataToPeer:(NSString*)peerID andSession:(GKSession*)session { if ([connections objectForKey:peerID]) { [delegate cardSent:[session displayNameForPeer:peerID

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Trygve Inda
> 2010/2/6 Trygve Inda : >> Any thoughts on a design pattern for this situation? > > I'd make your table view controller a subclass of NSViewController, > and instead of using a modal window I'd use a sheet, which your table > view controller would be the delegate of. All your logic gets to stay >

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Trygve Inda
> > On 07/02/2010, at 3:52 PM, Trygve Inda wrote: > >> The checkboxes window is in is own nib > [] > >> Any drawback to this? >> >> It seems like overkill to create a custom class to manage the checkbox >> window when all the checkboxes are controlled by bindings and there is only >> an OK/Canc

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Kyle Sluder
2010/2/6 Trygve Inda : > Any thoughts on a design pattern for this situation? I'd make your table view controller a subclass of NSViewController, and instead of using a modal window I'd use a sheet, which your table view controller would be the delegate of. All your logic gets to stay in one place

Re: Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Graham Cox
On 07/02/2010, at 3:52 PM, Trygve Inda wrote: > The checkboxes window is in is own nib [] > Any drawback to this? > > It seems like overkill to create a custom class to manage the checkbox > window when all the checkboxes are controlled by bindings and there is only > an OK/Cancel button. > >

Simple NSWindowController (or window in secondary nib)

2010-02-06 Thread Trygve Inda
I have a rather complex NSTableView that is managed by a custom class "TableController". This manages the array of data that the table will display I need to be able to put up a very simple modal window with checkboxes for each possible column (to set show/hide state) and OK/Cancel buttons. The c

Unable to add list to an entity

2010-02-06 Thread AmitKumar_Gupta06
Hi, I am trying to add a list into an entity through making relationship, but am not able to do so. I am using the following code [[aModel findRelationship:[relationArray lastObject]] setTargets:aNewList]; where aModel --- Entity aNewlist --- List. Ca

Strange Behavior

2010-02-06 Thread MARC BLATT
I have the following code in viewWillAppear: for my iPhone dev project (iPhone Development SDK Book, Chapter 4, p.63): - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.titleLabel.text = self.movie.title; NSNumberFormatter *formatter = [[

Wrong placement with -[NSWindow initWithContentRect:styleMask:backing:defer:screen:]

2010-02-06 Thread Jack Repenning
Under certain rather complex circumstances (which I'll describe in a moment), the window created by initWithContentRect:styleMask:backing:defer:screen: doesn't appear where it should in my program. But the demo program WhackedTV, running in identical context, and with a cut-and-pasted copy of _m

coredata: custom accessors

2010-02-06 Thread Roland King
I have two questions about coredata custom accessors, I've been reading the section about them, here's the code suggested for the setter of a property of type NSRect, in this instance the NSRect is cached in a local instance variable in the class. - (void)setBounds:(NSRect)aRect { [self wi

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Henry McGilton (Boulevardier)
On Feb 6, 2010, at 6:45 PM, Kyle Sluder wrote: > On Sat, Feb 6, 2010 at 3:45 PM, Development > wrote: >> I really like the sound of this solution. I've never worked with CGPaths, is >> that anything at all like NSBezierPath? >> because it seems like this might be the way to go. Can I use an Im

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Henry McGilton (Boulevardier)
On Feb 6, 2010, at 3:45 PM, Development wrote: > I really like the sound of this solution. I've never worked with CGPaths, is > that anything at all like NSBezierPath? Conceptually similar, in that a CGPath is the Core Graphics analogue of NSBezierPath. Just like NSBezierPath, you can create

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Kyle Sluder
On Sat, Feb 6, 2010 at 3:45 PM, Development wrote: > I really like the sound of this solution. I've never worked with CGPaths, is > that anything at all like NSBezierPath? > because it seems like this might be the way to go. Can I use an Image to > create a CGPath? No. This seems to be backward

Re: NSTextStorage subclass question

2010-02-06 Thread Kyle Sluder
On Sat, Feb 6, 2010 at 6:17 PM, Gideon King wrote: > I found the root cause of my problem - I was trying to call setSelectedRange > and setTypingAttributes on my text view in the textStorage processEditing > method, and the system didn't like that. I have altered it to use > perform...afterDela

Re: NSTextStorage subclass question

2010-02-06 Thread Gideon King
I found the root cause of my problem - I was trying to call setSelectedRange and setTypingAttributes on my text view in the textStorage processEditing method, and the system didn't like that. I have altered it to use perform...afterDelay: and it works fine now. Gideon___

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Development
I really like the sound of this solution. I've never worked with CGPaths, is that anything at all like NSBezierPath? because it seems like this might be the way to go. Can I use an Image to create a CGPath? On Feb 6, 2010, at 2:44 PM, Henry McGilton (Boulevardier) wrote: > > On Feb 6, 2010,

NSTextStorage subclass question

2010-02-06 Thread Gideon King
Hi, I have an NSTextStorage subclass, and I need to do post-processing that will replace the text with an altered version. From what I can understand, it appears that in order for me to pick it up once all the user changes are done, I need to override the processEditing and change the text to w

Re: NSLayoutManager vertical offset mystery

2010-02-06 Thread Andy O'Meara
Thanks guys! I didn't think to experiment with isFlipped since I thought there would be a way to make the cord algebra work (which would save me from having to do a backing store flip). I'm a carbon guy transitioning a carbon-based codebase to all cocoa, so I'm sure you'll see my ugly mug aga

Re: NSLayoutManager vertical offset mystery

2010-02-06 Thread Paul Sanders
Yes, there seems to be no way to reliably position text vertically in a graphics context that is not flipped. Strange but true. Paul Sanders. - Original Message - From: "Douglas Davidson" To: "Andy O'Meara" Cc: "Cocoa Developers" Sent: Saturday, February 06, 2010 10:31 PM Subject:

Re: Sheets, blocks and garbage collector

2010-02-06 Thread Frédéric Testuz
Le 6 févr. 2010 à 17:55, Michael Ash a écrit : > 2010/2/6 Frédéric Testuz : >> Hi all, >> >> I'm beginning a new application targeting Snow Leopard only. So I want to >> use the new tools (blocks) and garbage collection (GC). It will be my first >> application using GC. >> >> I read some sites

Re: NSLayoutManager vertical offset mystery

2010-02-06 Thread Douglas Davidson
Use a flipped context. Douglas Davidson On Feb 6, 2010, at 2:20 PM, Andy O'Meara > wrote: Hi gents, I have a small cocoa text layout issue that I could use some help from the veterans here, and I've been unable to make progress using google, ADC, or the list archives... I'm rendering s

NSLayoutManager vertical offset mystery

2010-02-06 Thread Andy O'Meara
Hi gents, I have a small cocoa text layout issue that I could use some help from the veterans here, and I've been unable to make progress using google, ADC, or the list archives... I'm rendering small words of text to a NSGraphicsContext using a vanilla NSLayoutManager/NSTextStorage/NSTextCont

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Henry McGilton (Boulevardier)
On Feb 6, 2010, at 11:28 AM, Paul Sanders wrote: > Perhaps you could use separate images and convert them to > monochrome, saving them as 1 bpp bitmaps (aka masks). Memory > should not then be an issue. > > Paul Sanders. > > - Original Message - > From: "Andrew Farmer" > To: "Jens

Re: Mixing TableView Bindings

2010-02-06 Thread Jerry Krinock
On 2010 Feb 05, at 13:47, Joe wrote: > Since the array controller's "object controller" can be set to a class or to > an entity but not both, I don't see how managed and unmanaged data can be > mixed. The short answer is: "Just do it". I do it all the time. As long as the object is KVC com

Re: Cocoa text via Quartz CGLayer

2010-02-06 Thread Sander Stoks
Hi Aki, Thanks! That was indeed the problem. I checked whether my whole CGLayer detour was still needed after disabling screen fonts (the reason was that rotated text looked bad) but I see that's still the case even with screen fonts disabled. Thanks again, Sander On Feb 6, 2010, at 7:54 PM

Re: NSScrollView & its width

2010-02-06 Thread Knut Lorenzen
Am 06.02.2010 um 17:20 schrieb Ken Thomases: >> Settings setWidthTracksTextView to NO works, but after doing that, the >> NSScrollView (parent of the TextView in question) clips the content to its >> own width :/ >> >> Perhaps there is a good reason that even TextEdit does not support this? >

Re: keyCode translation for various keyboards

2010-02-06 Thread John Joyce
On Feb 3, 2010, at 8:23 AM, cocoa-dev-requ...@lists.apple.com wrote: > Dave Carpeneto wrote: >> Hello list folk - I'm trying to print out strings representing various >> keyDown events I receive. Using OS 10.6.2. > ... >> So far the two approaches I've seen are as follows: > ... >> Approach #2:

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Paul Sanders
Perhaps you could use separate images and convert them to monochrome, saving them as 1 bpp bitmaps (aka masks). Memory should not then be an issue. Paul Sanders. - Original Message - From: "Andrew Farmer" To: "Jens Alfke" Cc: Sent: Saturday, February 06, 2010 7:19 PM Subject: Re: T

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Andrew Farmer
On 6 Feb 2010, at 11:05, Jens Alfke wrote: > The easiest way to do this is to create an NSBezierPath in the shape of the > trapezoid and call -containsPoint: on it; but IIRC, that class doesn't exist > on iPhone. Fortunately the math for hit-testing convex polygons is pretty > easy: check any co

Re: RegisterEventHotKey and keylogging

2010-02-06 Thread Andrew Farmer
On 6 Feb 2010, at 02:34, Michael Vannorsdel wrote: > I found that I can hotkey any keys and then use CGEventPost to post the key > to the front application. This effectively lets me track all the keys the > user presses from a non-privileged application while still sending input to > the key wi

Re: Touch: Non-rectangular Touch areas

2010-02-06 Thread Jens Alfke
On Feb 6, 2010, at 10:54 AM, Development wrote: > I have an app I am working on and several of the touch zones or buttons > occur within a trapezoid. Because these trapezoids touch one another to > complete a picture I need for the zones to be precise. What I'm not sure how > to accompli

Touch: Non-rectangular Touch areas

2010-02-06 Thread Development
I have an app I am working on and several of the touch zones or buttons occur within a trapezoid. Because these trapezoids touch one another to complete a picture I need for the zones to be precise. What I'm not sure how to accomplish is allowing touch within the border of the trapezoid

Re: Cocoa text via Quartz CGLayer

2010-02-06 Thread Aki Inoue
It's the screen font setting that's causing the shift between the two. When you use the screen font, CoreGraphics tries to position the glyph origin at the pixel boundary as much as possible. In this case, because of the way two rendering types differ how interpret the pixel boundary, the shift

Re: Dealing with rotten nibs

2010-02-06 Thread Henry McGilton (Boulevardier)
On Feb 6, 2010, at 9:57 AM, Matthew Weinstein wrote: > It's associated with an NSDocument... > > On Feb 6, 2010, at 9:41 AM, edole...@gmail.com wrote: > >> is it assoc with a view controller class? >> >> -- >> Sent from the Verizon network using Mobile Email >> >> --Original Messa

Re: Dealing with rotten nibs

2010-02-06 Thread Matthew Weinstein
It's associated with an NSDocument... On Feb 6, 2010, at 9:41 AM, edole...@gmail.com wrote: is it assoc with a view controller class? -- Sent from the Verizon network using Mobile Email --Original Message-- From: Matthew Weinstein To: Date: Sat, Feb 6, 8:55 AM -0800 Subject:

Re: Dealing with rotten nibs

2010-02-06 Thread edole...@gmail.com
is it assoc with a view controller class? -- Sent from the Verizon network using Mobile Email --Original Message-- From: Matthew Weinstein To: Date: Sat, Feb 6, 8:55 AM -0800 Subject: Dealing with rotten nibs I have a very large nib file that lately has refused to make any co

Re: Sheets, blocks and garbage collector

2010-02-06 Thread Michael Ash
2010/2/6 Frédéric Testuz : > Hi all, > > I'm beginning a new application targeting Snow Leopard only. So I want to use > the new tools (blocks) and garbage collection (GC). It will be my first > application using GC. > > I read some sites on GC and blocks. In the blog of Mike Ash I found some ver

Dealing with rotten nibs

2010-02-06 Thread Matthew Weinstein
I have a very large nib file that lately has refused to make any connections. I can cntrl-click and get the wire but the other end is refused by all objects. Nothing seems to allow connections either interface elements or objects; outlets or actions... Has anyone run into this, and any fixe

Re: NSScrollView & its width

2010-02-06 Thread Ken Thomases
On Feb 5, 2010, at 5:27 PM, Knut Lorenzen wrote: > Am 05.02.2010 um 01:10 schrieb Mark Sanvitale: > > <...> > >> (I repeat, this is only a somewhat educated stab-in-the-dark, i.e. I have >> used NSTextContainer's setWidthTracksTextView method. More informed people >> should still be encourage

No one? Fwd: NSCollectionView and its Items

2010-02-06 Thread Joachim Deelen
Hi, enclosed a repost of my Question / Problem. Any ideas, comments would be appreciated... Thanks, Joachim Anfang der weitergeleiteten E-Mail: > Von: Joachim Deelen > Datum: 2. Februar 2010 23:40:30 MEZ > An: Cocoa-dev List > Betreff: NSCollectionView and its Items > > Hi, > > is it poss

Sheets, blocks and garbage collector

2010-02-06 Thread Frédéric Testuz
Hi all, I'm beginning a new application targeting Snow Leopard only. So I want to use the new tools (blocks) and garbage collection (GC). It will be my first application using GC. I read some sites on GC and blocks. In the blog of Mike Ash I found some very interesting propositions. My questio

Re: logic problem. adding sine wave pattern to dynamic float

2010-02-06 Thread Chunk 1978
*renters with damaged heat shields* sorry, once again. i've posted this to stackoverflow here: http://stackoverflow.com/questions/2212275/compensating-for-value-change-while-changing-value On Fri, Feb 5, 2010 at 4:55 PM, Graham Cox wrote: > > On 06/02/2010, at 1:02 AM, Chunk 1978 wrote: > >> he

Re: viewDidUnload while view is still onscreen

2010-02-06 Thread Mike Abdullah
We're going to need a stack trace or *something* to offer anything helpful. On 6 Feb 2010, at 04:59, Charles Burnstagger wrote: > The viewDidUnload: method for one of my iPhone app's views gets called even > when that view and all its subviews are still onscreen. (I assume in response > to the

Re: RegisterEventHotKey and keylogging

2010-02-06 Thread Michael Vannorsdel
I found that I can hotkey any keys and then use CGEventPost to post the key to the front application. This effectively lets me track all the keys the user presses from a non-privileged application while still sending input to the key window/process. I was also able to see my admin pass as

Re: Cocoa text via Quartz CGLayer

2010-02-06 Thread Sander Stoks
Thanks for looking at this David, The "selection" isn't really there in my application; I added this later to the screen shots to show more clearly what was going on. For those reading along who don't want to download the screen shot, here's what's happening: I print the string "abcabcabcabcab