Re: OutlineView with big text editor

2010-11-27 Thread Patrick Mau
On 27.11.2010, at 15:43, gMail.com wrote: > Hi, I have set a custom cell showing icon + text on my outlineView column. > It works well, but whenever I double click on the row to edit the text, I > get a text field editor bigger than the cell itself and covering the left > icon. How can I make thi

Re: NSTableView within NSScrollView in code

2010-11-11 Thread Patrick Mau
Krinock wrote: > > On 2010 Nov 10, at 14:09, Patrick Mau wrote: > >> So someone must tell the tableView that it should resize its colums in >> response >> to a scrollview frame change. > > Try poking it w

Re: NSTableView within NSScrollView in code

2010-11-10 Thread Patrick Mau
Hallo Kyle Thanks for your remarks, but that's not it (unfortunately, see below). On 10.11.2010, at 22:54, Kyle Sluder wrote: > On Wed, Nov 10, 2010 at 1:34 PM, Patrick Mau wrote: >> >> Hallo everyone >> >> When I embed an NSTableView in an NScrollView, everyt

NSTableView within NSScrollView in code

2010-11-10 Thread Patrick Mau
Hallo everyone When I embed an NSTableView in an NScrollView, everything works except column auto-resizing. What would trigger automatic column layout whenever the NSScrollView frame is reduced in size? I have a custom view that creates a NSScrollView and NSTableView: - (id)initWithFrame:(NSRec

Re: NSCell and partial redraw

2010-08-31 Thread Patrick Mau
Hallo Fritz Thanks a lot for your comments. I just have a few remarks to clarify what I meant. Please see below. On 31.08.2010, at 17:26, Fritz Anderson wrote: > On 31 Aug 2010, at 4:59 AM, Patrick Mau wrote: > >> Let's assume I have a custom NSView that will use to custom

NSCell and partial redraw

2010-08-31 Thread Patrick Mau
Hallo everyone Let's assume I have a custom NSView that will use to custom NSCell instances to render its contents. Now, if "drawRect:" is called on the NSView, I get the dirty rect that needs to be redrawn. The NSCell class on the other hands uses: - (void)drawWithFrame:(NSRect)cellFrame inVi

IB Plugin Container View and child management

2010-05-03 Thread Patrick Mau
Dear list members I have created in IB Plugin based on the Xcode template and everything works fine. If you need the completly boring source to help me out I can upload the full project somewhere. Here's what I'd like to accomplish: I have a custom NSView subclass that is configured to be a co

Re: Custom NSFormatter classes

2010-01-04 Thread Patrick Mau
directly on the setDots: method of the Foo class, > without having to implement a separate action for each setXXXDot(s) ? How > about displaying a checkmark on the menu item for the current state? > > > On Jan 3, 2010, at 1:58 PM, Patrick Mau wrote: > >> Hallo Henri >&g

Re: Custom NSFormatter classes

2010-01-03 Thread Patrick Mau
Hallo Henri Your assumption about how formatters should work are correct. To provide a useful answer I have setup a mini project here, because I have stumbled over a detail I did not now: http://public.me.com/pmau I took your approach and implemted a minimal datasource and a "Foo" object. This

Re: Document-based application issue

2009-12-30 Thread Patrick Mau
Hallo Mac Lancer I have recently developed my first Cocoa Aplication creating custom ducumen bundles. What I did was to not only registering the document types but also export the file types in case they are not yet registered. This was my first app that supports a quicklook plugin for previes an

NSComparisonResult and equality

2009-07-01 Thread Patrick Mau
Hello everyone Here's a really short question regarding possible future API changes. Since NSComparisonResult is an ordered enum typedef, I'd like to know if it's safe to write the following code to test for 'greater or equal to': // This would cover both NSOrderAscending and NSOrderSame if

Re: instance management in IB

2009-05-11 Thread Patrick Mau
Hallo Chris The NIB loading guide states that custom objects, like your model object, are created using 'initWithCoder' and not plain 'init'. I would advise you to implement 'awakeFromNib' in your view and use NSLog() to print your datasource and its buffer or simply to set a breakpoint there

Re: Possible blunder with CALayers

2009-02-27 Thread Patrick Mau
Hallo rajesh I'm no expert and just took a brief look at your code. You are being notified on your NSView frame change and add all your layers to your NSView again in 'layout'. This happens on each resize. This looks very suspicious, because you should only add your layers once and later cha

Re: Stop edit session with a NSTextField

2009-02-24 Thread Patrick Mau
Hi Eric I was going through your last messages on this list, because I'm working on a similar problem. Reading through the code snippets you showed here, it isn't clear to me how your controls are being created. Are you creating a subclass of NSControl and afterwards add your GUI elements

Re: Stop edit session with a NSTextField

2009-02-23 Thread Patrick Mau
On 23.02.2009, at 16:50, Eric Gorr wrote: I am not sure I understand this. Are you are saying is that you looked for the NSTextView being used as the field editor for the NSTextField and then removed the NSTextView from it's superview? I tried this: id fieldEditor = [[aNotification use

Re: Stop edit session with a NSTextField

2009-02-23 Thread Patrick Mau
On 23.02.2009, at 16:20, Eric Gorr wrote: I manually start an edit session with a NSTextField after the user clicks in the field by doing the following: [snip] I can then alter the text in the field and press return. Once I press return, the delegate of the field does get a controlTex

Re: constraining autoresizing of a splitview subview

2008-12-13 Thread Patrick Mau
Hi Christophe The code below should be implemented in your NSSplitView's delegate. The 'sender' argument is your splitView. It will pick the first two subviews and adjust the width of the right subview (index 1). The height will be adjusted to your splitview's frame. I hope it's useful, Patrick

Re: Drawing NSTextFieldCell subclass in table view

2008-12-13 Thread Patrick Mau
On 13.12.2008, at 23:11, Andre Masse wrote: Hi, I want to display a cell like mail's message count in a table view but with a fixed size and centered on both axes. I've created a NSTextFieldCell subclass and its doing fine except that it draws in the first row only, which could mean I'm

Re: NSTableView Selection

2008-12-12 Thread Patrick Mau
Hi David To prevent automatic row selection, you have to allow "Empty" selections in your table. Select your Table-View in IB, open the attributes inspector and check "Empty" to be enabled. It's in the "Selection" part, near "Multiple", "Column" and "Type Select". Regards, Patrick On

NSKeyedArchiever and XML Format

2008-12-11 Thread Patrick Mau
Good morning For the last day I have pulled my hair over NSKeyedArchiever and friends to load and save small data objects. I mainly use this feature for debugging, so the output format is set to XML. Normally, one would write an object 'p' in binary format, using: [NSKeyedArchiver arch

Re: Right way to implement contextual menu in table/outline view?

2008-12-08 Thread Patrick Mau
Hi Graham On 09.12.2008, at 04:51, Graham Cox wrote: In my app I have an NSOutlineView. I have contextual menus relating to the overall table, but also relating to an individual item row. I notice that when I right-click on a row, I get a special highlight (blue outline) independent of the

Re: Programmatically adding an NSTableView to another view

2008-12-08 Thread Patrick Mau
Hi Randall On 09.12.2008, at 04:14, Randall Meadows wrote: I have configured a view .xib with an NSTableView; I load the nib and add the table view to another parent view. I've implemented the necessary delegate and data source methods. It's all working just peachy, except... It's plac

Re: Viewing Documentation in Safari

2008-12-02 Thread Patrick Mau
On 02.12.2008, at 15:43, Jeff Johnson wrote: Then I logged out and logged back in. This provides a permanent solution to the dialog problem, not only for Xcode docs but in general. If you want a more specific solution, try this: sudo find /Developer/Documentation/DocSets -exec xattr -d c

Re: Xcode messes up my Log Files

2008-12-02 Thread Patrick Mau
Hi Gerriet Somebody wrote a nice Xcode plugin at: http://0xced.blogspot.com/2008/09/quietxcode.html I never tried it myself, but thought it was a cool idea when I googled for a similar problem. Regards, Patrick On 02.12.2008, at 08:26, Gerriet M. Denkmann wrote: Whenever Xcode is running

Re: Subview frames and bounds

2008-11-03 Thread Patrick Mau
On 03.11.2008, at 14:23, DKJ wrote: I'm still puzzled by frames and bounds. I put this in the drawRect: of MyView: [[NSColor redColor] set]; NSRectFill( self.frame ); [[NSColor blueColor] set]; NSFrameRect( self.bounds ); I put this in the awakeFromNib of my c

Re: Simultaneous CoreAnimations

2008-11-02 Thread Patrick Mau
riggered by 'setNeedsDisplay' above. } You can implement a single delegate object for all registered animations. I hope my short answer gives you enough clues, otherwise I implement a complete example. Regards, Patrick On 02.11.2008, at 23:13, Jeshua Lacock wrote: On Nov

Re: Simultaneous CoreAnimations

2008-11-02 Thread Patrick Mau
On 02.11.2008, at 20:10, Jeshua Lacock wrote: Hello again, Hi Jeshua I have one question - hopefully not for myself this time. :) Is there a callback or some way to determine when a CAKeyframeAnimation has finished playing? Or do I need to set up a timer and calculate when a animation ha

Re: Subview display problem

2008-10-28 Thread Patrick Mau
Hi DKJ, On 28.10.2008, at 14:23, DKJ wrote: I'm having no luck getting a subview to display. In the awakeFromNib of the controller I have this: helpView = [[MyView alloc] init]; [helpView setFrameOrigin:RectCentre( [theView frame] )]; [helpView setFrameSize:NSZeroSize

Re: CALayer graphics context

2008-10-22 Thread Patrick Mau
Hi dkj A CALayer itself is not associated with a context. The NSView owns the graphics context. The context you are looking for is passed to the "drawLayer:inContext" message. Simply set a delegate of your layer and send 'setNeedsDisplay' once to setup your content. Here's an example: -

Re: Putting an image on a CALayer

2008-10-22 Thread Patrick Mau
On 22.10.2008, at 02:54, DKJ wrote: Me again. I've been using this code: NSURL *url = [NSURL fileURLWithPath:fname]; CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url, NULL); CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL); CFRelease(sour

Custom CALayer Action as animation key?

2008-10-20 Thread Patrick Mau
Good afternoon, I have implemented a layer-based view that acts as the layer delegate and defines a layer action named "test". Afterwards I create a CABasic animation to animate the test property. If you look at the line marked 'THIS WORKS", you'll see that sending "setValue:forKey" triggers

Re: Cocoa and C99

2008-10-06 Thread Patrick Mau
Hi Gerrit You could use explicit basic blocks: static void loop(void) { int i = 5; float f = 10.0; this(); and_that(); /* new badic block */ { int i; float f = 1.0; for (i = 0; i < 5; i++) {

Re: External C function and duplicate symbol

2008-10-03 Thread Patrick Mau
Hi Christian If you really want a function to appear in multiple object files you could declare them static, like in: static void vec_zero2(int *vect) { vec[0] = vec[1] = 0; } This is sometimes useful if you want to inline small functions and not use preprocessor macros like this: stat

Re: NSWindowController retain count confusion

2008-10-01 Thread Patrick Mau
On 30.09.2008, at 04:30, James Walker wrote: I have an NSWindowController subclass that is defined as File's Owner in a nib. The window outlet is connected to a window, and the delegate outlet of the window goes back to the File's Owner. I was trying to release the controller in the window

Re: lauchd and svnserve

2008-09-24 Thread Patrick Mau
I hope you don't mind sharing my plist. Please note the 'PathState', that avoids the mentioned mount issues. In addition, I use User/Group settings and decimal umask 23 ("027" octal). http://www.apple.com/DTDs/PropertyList-1.0.dtd "> Debug GroupName _svn

Re: Drawing an NSImage in a CALayer

2008-09-20 Thread Patrick Mau
Hi Matt I'm not involved in the discussion. I just wanted to thank you for the complete example, because I'm following this thread too. Regards, Patrick On 19.09.2008, at 19:48, Matt Long wrote: Hey Brad, I re-read my message and realized I was a bit condescending in my comments. Not su

Re: Blue lines (nice example app including quartz compositions)

2008-07-15 Thread Patrick Mau
Andrew Thompson wrote: > How do Interface Builder and Quartz Composer draw the blue line connections > from object to object? > I have been looking through the APIs, but I can't find anything that looks > right. > > I thought of just drawing my own line on a custom view (shouldn't be that > hard),

Re: Design Question: Where to observe using KVO?

2008-07-13 Thread Patrick Mau
Ken Thomases wrote: > How about a dictionary whose keys are NSValues representing the > objects? For each object, the value from the dictionary would be an > NSMutableArray whose elements are the key paths being observed on that > object. > > // ... > NSValue* objectKey = [NSValue valueW

Re: Design Question: Where to observe using KVO?

2008-07-10 Thread Patrick Mau
I. Savant wrote: >> Check out this page: >> >> http://homepage.mac.com/mmalc/CocoaExamples/controllers.html >> > > I should also mention that you should approach these examples like this: > > 1 - Read the Cocoa Bindings documentation (including all the Key Value > Coding / Key Value Observing r

Design Question: Where to observe using KVO?

2008-07-10 Thread Patrick Mau
Hallo everyone I would appreciate if someone wants to comment on my conceptual design question: I have developed a custom NSView displaying a pie chart. The data is an NSMutableArray containing NSMutableDictionary instances for the pie segments (a standard NSArrayController instance). Each segme