Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Graham Cox
On 02/01/2010, at 6:57 PM, Joshua Garnham wrote: > How would I use that? RTFM: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/TextArchitecture/TextArchitecture.pdf --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

NSBezierPath linewidth not correct

2010-01-02 Thread Gustavo Pizano
Hello all once again. Well this is happening when drawing a line in a view which has a me after NSDrawNinePartImage as background; The Line it seems to be 2.0px;, this is what Im doing in drawRect NSDrawNinePartImage(frame, _topLeft, _top, _topRight, _leftCallout, _center, _right, _bottom

Re: NSBezierPath linewidth not correct

2010-01-02 Thread Graham Cox
On 02/01/2010, at 9:29 PM, Gustavo Pizano wrote: > but nothing seems to work... what am I missing here? You're drawing the line at an integer coordinate. That places it exactly between the pixels on the screen, so to anti-alias the line, it gets drawn on both sides at half brightness. Adding

Re: NSBezierPath linewidth not correct

2010-01-02 Thread Gustavo Pizano
:S:S:S:S I didn't realize it... I was suspecting such a thing... adding a .5 to the Y values of the path fix the whole thing.. thx a lot!!! :D Gustavo On Jan 2, 2010, at 11:37 AM, Graham Cox wrote: > > On 02/01/2010, at 9:29 PM, Gustavo Pizano wrote: > >> but nothing seems to work... w

Re: NSBezierPath linewidth not correct

2010-01-02 Thread Gustavo Pizano
Forgot to mention... or ask. I guess this come from where the view its positioned.. so If I want to draw anything I will have to do it at .5 on each point, shall I change instead the y origin to a .5 coordinate so I will don't don't put .5 on each drawing I make in the view? or the mistake com

Re: NSBezierPath linewidth not correct

2010-01-02 Thread Gustavo Pizano
No worries, I modify it and in fact it does work, but the background images will display a .5 gap between along the horizon between the images that conform the background, so I will put just a .5 to everywhere I need instead... Gustavo On Jan 2, 2010, at 11:43 AM, Gustavo Pizano wrote: > Fo

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Paul Sanders
Well, I have to say Graham has a point there, and I'm not going to write your code for you, but what I do goes something like this: 1. Get the current typing attributes from my NSTextView (as an NSDictionary) 2. Make a mutable copy (as an NSMutableDictionary) 3. Retrieve the current NSPara

Re: Custom NSWindow drawing

2010-01-02 Thread John Joyce
On Jan 2, 2010, at 4:43 AM, cocoa-dev-requ...@lists.apple.com wrote: Custom NSWindow drawing To: cocoa-dev@lists.apple.com Message-ID: <120d436a-24e6-4174-9858-dea4eb3ff...@gmail.com> Content-Type: text/plain; charset=us-ascii I want to draw an NSWindow that looks similar to this: http://vib

Difficulty binding an NSArrayController to an NSTreeController

2010-01-02 Thread Rick Mann
I've got a Core Data model with a Group entity and Part entity. Each Part belongs to a Group, and Groups can belong to Groups. The NSTreeController and NSOutlineView work fine to display the Group hierarchy, but I can't seem to get the NSArrayController to bind to the tree controller's selection

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Andy Lee
On Jan 2, 2010, at 6:04 AM, Paul Sanders wrote: > I think it's Hillegass who > recommends getting plenty of sleep. Ten hours! I keep meaning to try that suggestion, I think there must be something to it. --Andy ___ Cocoa-dev mailing list (Cocoa-dev

Re: Drawing on top of QTCaptureView

2010-01-02 Thread Bengt Nilsson
Thanks for the advice. Some extreme newbie questions: A) Any documentation on this subject? Can this be done in IB? B) What is the simplest object that will draw a simple line? I have found NSBox (from IB) and NSBezierPath from docs, both with lots of bells and whistles... Is there no NSLine, N

Re: Drawing on top of QTCaptureView

2010-01-02 Thread Mike Abdullah
On 2 Jan 2010, at 13:42, Bengt Nilsson wrote: > Thanks for the advice. Some extreme newbie questions: > > A) Any documentation on this subject? Can this be done in IB? http://www.google.com/search?client=safari&rls=en&q=cocoa+overlay+window&ie=UTF-8&oe=UTF-8 > > B) What is the simplest object

Re: Drawing on top of QTCaptureView

2010-01-02 Thread Graham Cox
On 03/01/2010, at 12:42 AM, Bengt Nilsson wrote: > B) What is the simplest object that will draw a simple line? I have found > NSBox (from IB) and NSBezierPath from docs, both with lots of bells and > whistles... Is there no NSLine, NSPath? NSBezierPath. For a simple line, there is the class

Re: NS_INLINE and obj = nil;?

2010-01-02 Thread Alexander Spohr
Am 02.01.2010 um 05:09 schrieb Stephen J. Butler: > If you really wanted a macro, it would look like this: > > #define GDRelease(x) do { [(x) release]; (x) = nil; } while (0) What is the do while good for? Would this not work as well: #define GDRelease(x) { [(x) release]; (x) = nil; } Or even

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Joshua Garnham
Thanks for the Guide/Walkthrough, Here's what I have come up with from that: NSDictionary *tA = [textView typingAttributes]; NSMutableDictionary *tAM = [tA mutableCopy]; NSParagraphStyle *pS = [tAM objectForKey:NSParagraphStyleAttributeName]; NSMutableParagraphStyle *pSM = [pS muta

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Paul Sanders
Yep, that looks ok. I think pS is probably being returned as nil. You can check this in Xcode. In which case, you can add: if (pS == nil) pS = [NSParagraphStyle defaultParagraphStyle]; Paul Sanders. - Original Message - From: Joshua Garnham To: Paul Sanders Cc: cocoa-dev@lists

Re: NS_INLINE and obj = nil;?

2010-01-02 Thread David Duncan
On Jan 2, 2010, at 6:29 AM, Alexander Spohr wrote: > What is the do while good for? It lets you reliably write constructs like: if(condition) MyMacro(foo); -- David Duncan Apple DTS Animation and Printing ___ Cocoa-dev mailing list (Cocoa-dev@list

Re: NS_INLINE and obj = nil;?

2010-01-02 Thread Clark Cox
On Sat, Jan 2, 2010 at 6:29 AM, Alexander Spohr wrote: > > Am 02.01.2010 um 05:09 schrieb Stephen J. Butler: > >> If you really wanted a macro, it would look like this: >> >> #define GDRelease(x) do { [(x) release]; (x) = nil; } while (0) > > What is the do while good for? > > Would this not work

Re: NS_INLINE and obj = nil;?

2010-01-02 Thread Alexander Spohr
Am 02.01.2010 um 17:28 schrieb Clark Cox: > On Sat, Jan 2, 2010 at 6:29 AM, Alexander Spohr wrote: >> Would this not work as well: >> #define GDRelease(x) { [(x) release]; (x) = nil; } >> >> Or even this: >> #define GDRelease(x) [(x) release], (x) = nil; > No, neither would work as well. Con

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2010-01-02 Thread Joshua Garnham
Thanks that works now! From: Paul Sanders To: Joshua Garnham Cc: cocoa-dev@lists.apple.com Sent: Sat, 2 January, 2010 15:03:11 Subject: Re: Setting the Line Height/ Line Spacing in an NSTextView.  Yep, that looks ok. I think pS is probably being returned

Re: Array Controller "Select Inserted Objects" [SOLVED]

2010-01-02 Thread Mike Abdullah
On 2 Jan 2010, at 05:12, Jerry Krinock wrote: > > On 2009 Dec 05, at 22:43, Jerry Krinock wrote: > >> I tested a new build of an app today and found that, all of a sudden, >> clicking the "+" button for a table view adds a new object but no longer >> selects it. > > The problem was that I wa

Re: Alternative KVC accessors

2010-01-02 Thread Mike Abdullah
On 1 Jan 2010, at 21:45, Shane Stanley wrote: > On 1/1/10 11:15 PM, "Mike Abdullah" wrote: > >> Are you saying you want a synthesized - method, and then also write an >> -is method? > > Sort of... What I'm actually trying to do is write a getter in > AppleScriptObjectiveC. > > When you declar

Re: Custom NSWindow drawing

2010-01-02 Thread PCWiz
Thanks for the suggestions. What I have in mind is just a standard NSWindow, but with a few tweaks to integrate it better with NSStatusItem. I'll first try the child window method. The only reason I dont want to completely draw the whole window is that resizing is not easily implemented with a c

Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread PCWiz
I have a bottom bar in my Cocoa app, and when I drag from the bottom bar it moves the window. One solution here would be to add a child window that covers the bottom bar and intercepts all mouse events, but I want the window to be able to resizeable by the bottom right corner and a child window

Re: Saving position in NSTextView

2010-01-02 Thread Pascal Harris
Okay, I think I have this kind of sorted (courtesy of this source and, of course, Google) - so if anyone else needs to do this in the future, they can do it with this code: To save position: NSPoint containerOrigin = [textViewLarge textContainerOrigin]; NSRect visibleRect = [textViewLarge visible

Re: Custom NSWindow drawing

2010-01-02 Thread John C. Randolph
On Jan 2, 2010, at 10:44 AM, PCWiz wrote: The only reason I dont want to completely draw the whole window is that resizing is not easily implemented with a custom window. Sure it is. This is how I did it in the "Core Data Stickies" example: #import "StickyResizeCornerView.h" @implementat

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread Nick Zitzmann
On Jan 2, 2010, at 11:48 AM, PCWiz wrote: > I have a bottom bar in my Cocoa app, and when I drag from the bottom bar it > moves the window. One solution here would be to add a child window that > covers the bottom bar and intercepts all mouse events, but I want the window > to be able to resiz

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread PCWiz
The window is going to be "attached" to an NSStatusItem, so it would be best if it stayed in one spot. Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-01-02, at 3:09 PM, Nick Zitzmann wrote: > > On Jan 2, 2010, at 11:48 AM, PCWiz wrote: > >> I have a bottom bar in

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread Nick Zitzmann
On Jan 2, 2010, at 3:12 PM, PCWiz wrote: > The window is going to be "attached" to an NSStatusItem, so it would be best > if it stayed in one spot. OK, that's a good enough reason. :) Did you try adding a custom view to the affected area that (1) is transparent, and (2) "acts" on mouse events

Problem deploying a NSCollectionView in Leopard

2010-01-02 Thread James Bucanek
Greetings, I have an odd problem and was just hoping that someone else has encountered this and might know what's going on. I've written a Service for Snow Leopard that replaces a contextual menu plug-in in Tiger and Leopard. It put up a HUD-style window that contains: - An NSCollectionVie

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread PCWiz
I didn't try an NSView but I tried something similar. I tried creating a new NSWindow with the NSBorderlessWindowMask, setting its background color to -[NSColor clearColor] and then positioning it over the bottom bar. This worked...kinda, except for the fact that instead of the "clear" color, th

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread Nick Zitzmann
On Jan 2, 2010, at 3:31 PM, PCWiz wrote: > In any case, I still want the resize corner to work, and using a window or a > view to cover it would block out the resize corner as well. I don't understand. If that's your problem, then why don't you cut the mouse-event-eater off just to the left of

[[sender selectedCell] tag] crashes in 10.6

2010-01-02 Thread Henrietta Read
Hi, Think I must be doing something wrong, I just got a new laptop with 10.6 for Christmas. My app that works fine in 10.5 seems to have all its pop-up menus broken... ??? Here's the code: - (IBAction)myPopupButton:(id)sender { gMyPopupButtonSetting = [[sender selectedCell] tag]; } 'gMyPop

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread PCWiz
Yeah its a non rectangular area, so I'll probably have to go with the second instance. And also I need some clarification on the mouse event eater. Would it just be something like this in the subclass: - (void)mouseDown:(NSEvent*)theEvent { // Do nothing } Or something else? Indepe

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread Nick Zitzmann
On Jan 2, 2010, at 3:45 PM, PCWiz wrote: > And also I need some clarification on the mouse event eater. Would it just be > something like this in the subclass: > > - (void)mouseDown:(NSEvent*)theEvent > { > // Do nothing > } That's correct; you just need to make it so that the default im

Re: [[sender selectedCell] tag] crashes in 10.6

2010-01-02 Thread Graham Cox
On 03/01/2010, at 9:40 AM, Henrietta Read wrote: > Think I must be doing something wrong, I just got a new laptop with 10.6 for > Christmas. My app that works fine in 10.5 seems to have all its pop-up menus > broken... ??? > > Here's the code: > > - (IBAction)myPopupButton:(id)sender > { >g

Bindings/Core Data: Undesired Discovery of a Mythical "Deep Observer"

2010-01-02 Thread Jerry Krinock
I display several to-many relations in a Core Data app in tables via array controllers and Cocoa Bindings. I have a slight problem with the one that displays Agent <-->> Commands This table has two columns, both popup menus, which set the two attributes of Command objects. When I select a

Re: Array Controller "Select Inserted Objects" [SOLVED]

2010-01-02 Thread Jerry Krinock
On 2010 Jan 02, at 10:24, Mike Abdullah wrote: > That doesn't sound quite right to me. -newObject isn't supposed to insert the > object into the receiver. BUT, if in Entity mode, it will insert the object > into the managed object context, which in turn could cause it to show up in > the contr

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread PCWiz
Ah OK, sounds good. I'll give that a shot. Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-01-02, at 3:50 PM, Nick Zitzmann wrote: > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reques

Re: Make NSWindow immovable by dragging bottom bar

2010-01-02 Thread PCWiz
I just found an amazingly simple solution to this. Snow Leopard publicized a previously private API method, NSWindow's setMovable. All I did was [window setMovable:NO]; and it works ! Independent Cocoa Developer, Macatomy Software http://macatomy.com On 2010-01-02, at 3:50 PM, Nick Zitzmann w

Re: NSBezierPath linewidth not correct

2010-01-02 Thread Rob Keniger
On 02/01/2010, at 8:58 PM, Gustavo Pizano wrote: > No worries, I modify it and in fact it does work, but the background images > will display a .5 gap between along the horizon between the images that > conform the background, so I will put just a .5 to everywhere I need > instead... It wil

Re: Alternative KVC accessors

2010-01-02 Thread Shane Stanley
On 3/1/10 5:32 AM, "Mike Abdullah" wrote: > This sounds a pretty odd approach, and is also going to give you pretty > confusing code to read. It's not ideal, for sure. But it gives me a usable getter as long as I use valueForKey: calls, and therefore works fine with bindings, which is my main co

drawatpoint

2010-01-02 Thread John Kundert-Gibbs
Hi, all I'm fairly new to programming for the iPhone (still getting up to speed!), and I have a hopefully simple question about positioning and scaling graphic images in a UIImageView I created in IB. I'm trying to work with drawAtPoint and drawInRect to position and size the image(s) (there wi

Re: drawatpoint

2010-01-02 Thread David Duncan
On Jan 2, 2010, at 5:34 PM, John Kundert-Gibbs wrote: > I'm fairly new to programming for the iPhone (still getting up to speed!), > and I have a hopefully simple question about positioning and scaling graphic > images in a UIImageView I created in IB. I'm trying to work with drawAtPoint > and

Re: drawatpoint

2010-01-02 Thread Todd Heberlein
> I'm fairly new to programming for the iPhone (still getting up to speed!), ... > but I can't figure out from the docs, nor from online code examples, how to > do this. I liked the book "Beginning iPhone 3 Development: Exploring the iPhone SDK". It is a good way to get up to speed on iPhone de

Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread Charles Jenkins
Hello, everyone. I'm struggling through the steep Cocoa learning curve, and even things that should seemingly be very easy turn out to be difficult for me. I have an NSView in which I ask for the player names for a 4-person game. I have hooked the NSTextField objects to IBOutlet NSTextField* dat

Custom NSFormatter classes

2010-01-02 Thread Henri Häkkinen
Hello. I have an array of custom Foo objects which I would need to display in an NSTableView object. I implement the data source delegate like this: - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { return [arrayOfFoos count]; } - (id)tableView:(NSTableView *)tableView ob

Re: Why do bindings make my image disabled?

2010-01-02 Thread Jim Correia
On Jan 1, 2010, at 5:39 PM, Michael Bishop wrote: > What I have been able to figure out is that using bindings is somehow making > my NSImageCell instances draw an image semi-transparently. I haven't been > able to explain why this is but I'm hoping someone else has seen this. […] > In the pro

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread Eric E. Dolecki
Just wondering if you need to release that array. On Sat, Jan 2, 2010 at 2:44 PM, Charles Jenkins wrote: > Hello, everyone. I'm struggling through the steep Cocoa learning curve, and > even things that should seemingly be very easy turn out to be difficult for > me. > > I have an NSView in which

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread David Duncan
You should not be releasing pnl because you do not own a reference to it. The memory management rules explain why this is. -- David Duncan @ My iPhone On Jan 2, 2010, at 2:44 PM, Charles Jenkins wrote: Hello, everyone. I'm struggling through the steep Cocoa learning curve, and even thin

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread Roland King
you should go back and read the memory management documentation again until it's burned into your memory. arrayWithObjects returns an array you do not own and thus do not need to release (and must not). On 03-Jan-2010, at 3:44 AM, Charles Jenkins wrote: > Hello, everyone. I'm struggling thr

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread Yandy Ramirez
the method [NSArray arrayWithObjects:] returns an autoreleased object, there's no need for you to release it yourself. According to ObjC memory management guidelines you only release when you. Retain and object, init/alloc and object or copy it. In this case I think your array is getting released b

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread Roland King
On 03-Jan-2010, at 1:10 PM, Yandy Ramirez wrote: > the method [NSArray arrayWithObjects:] returns an autoreleased object, > there's no need for you to release it yourself. According to ObjC memory > management guidelines you only release when you. Retain and object, > init/alloc and object or cop

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-02 Thread Matt Neuburg
Message: 6 Date: Sat, 02 Jan 2010 14:44:21 -0500 From: Charles Jenkins Subject: Why is [NSArray arrayWithObjects:] failing for me? NSArray* pnl = [NSArray arrayWithObjects:pa,pb,pc,pd,nil]; [parentDocument setPlayerNameList:pnl]; [pnl release]; I think adding the strings to an array will

[iPhone] how do I stop a running thread

2010-01-02 Thread Tharindu Madushanka
Hi, I am creating a thread with method detachNewThreadSelector: How could I stop the thread while it is running ? Thank you, Tharindu Madushanka tharindufit.wordpress.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admi

Table views in combined tab/nav interface

2010-01-02 Thread Charles Burnstagger
I have a combined tab bar/navigation application whose navigation views each hold one table view. I've connected each navigation controller nib to a tab item in my tab bar controller and I've made the tab bar controller the root controller for the app like the docs say to. I know each of the n

Re: [iPhone] how do I stop a running thread

2010-01-02 Thread Glenn L. Austin
Your best bet -- have a flag that the thread can check for exiting. Terminating a thread from outside the thread could leave resources locked and unavailable. On Jan 2, 2010, at 9:49 PM, Tharindu Madushanka wrote: > I am creating a thread with method detachNewThreadSelector: > > How could I st

Re: Table views in combined tab/nav interface

2010-01-02 Thread Graham Cox
On 03/01/2010, at 4:55 PM, Charles Burnstagger wrote: > I have a combined tab bar/navigation application whose navigation views each > hold one table view. > > I've connected each navigation controller nib to a tab item in my tab bar > controller and I've made the tab bar controller the root c

Re: [iPhone] how do I stop a running thread

2010-01-02 Thread Michael Davey
To elaborate and agree... Run your thread in a loop such as: while (isRunning) { // work done here } and have a method such as: -(void)stopThread { isRunning = NO; } On 3 Jan 2010, at 16:56, Glenn L. Austin wrote: > Your best bet -- have a flag that the thread can check for ex

Re: [iPhone] how do I stop a running thread

2010-01-02 Thread Tharindu Madushanka
Thanks :) Tharindu Madushanka tharindufit.wordpress.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/Unsu