Re: newbe view question

2010-05-16 Thread Scott Thompson
I had thought about subclassing the window's content view but, yuch, there must be a better way. I have perused the literature if something is there I have missed it. Is there some way I can drop a folder onto a window or its content view get the name of the folder? Please point me in the

Re: resizing PDF obtained from dataWithPDFInsideRect:

2009-11-20 Thread Scott Thompson
On Nov 19, 2009, at 4:37 PM, Chinh Nguyen wrote: The conversion to screen coordinates is causing stair stepping in connected lines and other oddities when exporting to PDF. As a temporary solution until the code is rewritten, I've created a subclass of my view that's sized at the large

Re: Vector images on Cocoa

2009-11-19 Thread Scott Thompson
I would need some way of loading vectorized images from files and drawing them to my custom NSView derived class, scaled up or down according to the frame of the control. I was thinking of using SVG files but there seems not to be any easy way of handling them in Cocoa and I feel that

Re: stringWithCString:length deprecation

2009-10-07 Thread Scott Thompson
But that doesn't look like a real replacement. Shouldn't there be a stringWithCString:length:encoding What am I missing? I think what you're missing is: - (id)initWithBytes:(const void *)bytes length:(NSUInteger)len encoding:(NSStringEncoding)encoding; Scott

Re: #pragma to suppress a warning message

2009-09-16 Thread Scott Thompson
Also, can anyone point me to a list of the #pragma’s for xcode? I'm not sure what you are referring to when you say that your pragam warnings would have worked In gnu. Xcode is an IDE. The compiler most commonly used with Xcode is gcc which is the GNU C compiler. In Snow Leopard, you

Re: Does Mac OS X support interior pointers?

2009-09-09 Thread Scott Thompson
Those who disagree with me implicitly acknowledge I do not think that those who disagree with you must acknowledge your two premises implicitly or explicitly. A) The compiler is generating code that violates the C standard. You put a lot of effort into claiming that it's a given that the

Re: [iPhone] Custom -sizeWithFont: and CGContextRef question

2009-07-17 Thread Scott Thompson
On Jul 16, 2009, at 1:30 PM, Michael Hoy wrote: Hello all, For various reasons I'd like to implement a method similar in function to NSString's -sizeWithFont: (UIKit addition). The difference is it takes a CGFontRef. Here's a rough idea of the code (a slight adaptation of Timothy

Re: UITextView Doesn't seem to function

2009-07-16 Thread Scott Thompson
On Jul 16, 2009, at 9:09 PM, Development wrote: Actually its a UITextView, it is linked in IB and when I NSLog (@%@,about.text) it shows me that it has the string stored in the object, however it is not updating the onscreen view. Make sure that your text view is large enough to show the

Re: Why do CFType instances respond to NSObject messages?

2009-07-16 Thread Scott Thompson
On Jul 16, 2009, at 7:24 AM, Wilson Chen wrote: Hi all, I'm new to the Cocoa framework, and puzzled why the following code would work: CGLayerRef layer = ...assume we have a layer created. printf(Retain count after creation: %i\n, CFGetRetainCount(layer)); [(NSObject*)layer retain];

Re: How to write ipeg image created with CGImageRef?

2009-07-10 Thread Scott Thompson
I'm trying to save an NSBitmapImageRep initialized with - initWithCGImage: onto a disk. But the image of the saved file is bad. This means only black and white horizontal lines are drawn meaninglessly. The _rep in the below code is the NSBitmapImageRep instance allocated and initialized

Re: bypass NSApp

2009-07-10 Thread Scott Thompson
On Jul 10, 2009, at 3:40 PM, Julien Isorce wrote: In GNUstep it's possible to decide which pthread is the main thread. I mean the first pthread which call GSRegisterCurrentThread, is the main thread. And then the NSApp must be init and run in this main thread, as it's required on MacOSX.

Re: bypass NSApp

2009-07-10 Thread Scott Thompson
sure but in the previous mails I tried to explain that I am making a plugin (which consists of a dynamic library) of a program which I have not the source code. OK.. the application for which you are writing the plugin... is it a Cocoa application, a Carbon application, or something

Re: getting directories created from a certain time

2009-07-10 Thread Scott Thompson
On Jul 10, 2009, at 1:46 PM, I. Savant wrote: On Jul 10, 2009, at 2:43 PM, Angelo Chen wrote: I have a lengthy process where it creates a few directories, I'd like to know how to get a list of directories created since the starting of the process, any hints? Thanks, If you're targeting

Re: bypass NSApp

2009-07-09 Thread Scott Thompson
Sent from my iPhone On Jul 9, 2009, at 10:04 AM, Bill Bumgarner b...@mac.com wrote: On Jul 9, 2009, at 2:46 AM, Julien Isorce wrote: I am trying to isolate this difference in order to avoid to run the main loop in the main thread. Don't bother. Cocoa is quite explicitly designed to not

Re: setting a CGContextRef to the current Context

2009-07-08 Thread Scott Thompson
On Jul 8, 2009, at 6:03 PM, David Alter wrote: I have CGContextRef that I use for some quartz calls. It is a bitmap context. I would like to set it as the current context so that I can use NSString drawAtPoint: withAttributes:. I do not see how to do this. NSGraphicContext

Re: [Rubycocoa-talk] Alternative to NSGraphicsContext graphicsContextWithGraphicsPort:flipped:

2009-07-01 Thread Scott Thompson
On Wednesday, July 01, 2009, at 02:51PM, Duncan McGregor dun...@oneeyedmen.com wrote: Hi I'm writing PDF's with RubyCocoa, and want to set the current graphics context to a PDF context from CGPDFContextCreateWithURL so that I can draw on it. Essentially my code says (sorry, ObjC folks,

Re: Rendering a fixed-width text

2009-07-01 Thread Scott Thompson
On Jun 30, 2009, at 9:52 AM, Riccardo Canalicchio wrote: I'm developing an application for MacOSX, based on Core Animation. I would like to know the best way to render a fixed-width text paragraph inside a CALayer. I already tried with CATextLayer, which indeed gave me a fixed-width text

Re: How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage PNG Image at a specific coordinate?

2009-06-27 Thread Scott Thompson
On Jun 26, 2009, at 2:25 PM, Frederick C. Lee wrote: Environment: iPhone OS 3.0 Greetings: I would like to place one or more reference icons (png) upon a host image (png) {Like a street map with legends, landmarks, etc.}. I'm working with Quartz so I'm using pre-loaded CGImages via

Re: Problem: how to get glyph descent and ascent

2009-06-23 Thread Scott Thompson
On Jun 23, 2009, at 1:02 PM, Anders Lassen wrote: The font descent is the maximum descent for all characters in that font, so it will not help me to position the character correct Unfortunately the documentation on the text system in Mac OS X can be very difficult to navigate (as you

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread Scott Thompson
On Jun 19, 2009, at 2:20 PM, Chunk 1978 wrote: so i'm forced to subclass the rect... Hmm... There's no such thing as subclassing a rect. CGRect is a structure, not a class. my StrokeView:UIView class.m is this: - (id)initWithFrame:(CGRect)frame { if (self = [super

Objective-C variadic methods vs. NSArray et al.

2008-11-21 Thread Scott Thompson
Technical QA 1405 concerns the creation of Objective-C methods that take variable number of arguments... so called variadic methods. Happily the mechanisms just use the standard C mechanisms (va_start and friends). That being the case, why is it that methods like arrayWithObjects:

Re: Objective-C variadic methods vs. NSArray et al.

2008-11-21 Thread Scott Thompson
On Nov 21, 2008, at 5:52 PM, Clark Cox wrote: On Fri, Nov 21, 2008 at 3:40 PM, Scott Thompson [EMAIL PROTECTED] wrote: Technical QA 1405 concerns the creation of Objective-C methods that take variable number of arguments... so called variadic methods. Happily the mechanisms just use

Re: drawRect: called twice for NSView subclass.

2008-04-19 Thread Scott Thompson
On Apr 19, 2008, at 7:15 PM, William Hunt wrote: Essentially I have a window with a custom view atop a button. What happens at each refresh, however, is that the custom view's drawRect: is called twice. First it is called with the whole window's NSRect, then it is called with the proper

Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath

2008-04-18 Thread Scott Thompson
On Apr 17, 2008, at 4:28 AM, Heinrich Giesen wrote: Sorry, pressed the wrong button. And: if the bezier path shall always be drawn 1 pixel wide, independent of resolution and scaling the lineWidth should be set to 0 (zero) While this works for PostScript, it does not work for Quartz.

Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath

2008-04-18 Thread Scott Thompson
What function is drawing? I'm not sure this works with NSFrameRectWithWidth(), but it definitely does with NSBezierPath/ stroke. The NSFrameRect family of routines are odd ducks to begin with. In some ways, they tend to to be more pixel oriented than your typical drawing routines. For

Re: Bitmap data from CGImageRef

2008-04-18 Thread Scott Thompson
On Apr 18, 2008, at 1:54 PM, Carter R. Harrison wrote: Thanks Adam.. For some reason I cannot seem to find CGDataProviderCopyData in the Apple docs. I can search for it at the ADC, and it returns the page for CGDataProvider as the first hit, but once you go to that page, there is

Re: Leopard on PPC

2008-03-27 Thread Scott Thompson
On Mar 27, 2008, at 10:29 AM, Clark Cox wrote: On Wed, Mar 26, 2008 at 4:04 PM, Lorenzo [EMAIL PROTECTED] wrote: Hi Laurent, I am going to debug and let you know. Right now I have found these lines. Might they cause the trouble on Leopard PPC? No, but this line will cause problems

Re: Beginner with Cocoa

2008-03-24 Thread Scott Thompson
On Mar 24, 2008, at 7:12 AM, Jeff LaMarche wrote: I'g be rather surprised if the Cocoa books took out discussions of traditional objective-C memory managements in their next releases. It's still available for use, and as you mention, necessary for writing to earlier versions of the OS, not

Re: Garbage collection - was Beginner with Cocoa

2008-03-24 Thread Scott Thompson
On Mar 24, 2008, at 3:03 PM, colo wrote: But I do not wish to use the bridge options yet I would rather do it right in one place than trying to glue it together and spend days not getting it I'll make a compromise with you. :-) I'll let you try one... just one... RubyCocoa application

Re: Using C++ classes from Objective C

2008-03-20 Thread Scott Thompson
On Mar 20, 2008, at 2:34 PM, Jeremy wrote: Thanks everyone! Using a void* for the member variable of my wrapper class did the trick and I now have my Objective C code calling my C++ code! What is the best way to pass strings from my Objective C code to my C ++ code though? I started

Re: Python/Ruby for Cocoa (was: Simple question)

2008-03-18 Thread Scott Thompson
I completely agree - and I wrote CamelBones, the Cocoa/Perl bridge. It is, and always has been, my opinion that language bridges are not an adequate substitute for learning Cocoa's native language, Objective-C. What they are *great* for is giving additional options to a skilled programmer

Re: Simple question

2008-03-17 Thread Scott Thompson
On Mar 17, 2008, at 7:53 AM, Luca Ciciriello wrote: Yes, you got it. .h stands for header and is the place where you make your declarations, .m stands for module and is where the definitions take place. You can encounter also .mm exetension. In these file you can mix Objective-C an