Trouble with design pattern

2011-02-18 Thread Carlos Eduardo Mello
Hi Everyone, I am comming back to cocoa programming and to this list after a few years without programming anything, so please forgive me in advance for any stupid questions. I've read the docs, studied Hillegass's book again and searched the archives, but still couldn't find a definitive

Re: Trouble with design pattern

2011-02-18 Thread Carlos Eduardo Mello
If I just query the window controler for the document on demand like this: [ [ [ [ self window ] windowController ] document refreshParameters ]; the code works, but I still can't get rid of those "message-not- found" warnings: One correction: calls without arguments seem to be ok like this

Re: Trouble with design pattern

2011-02-18 Thread Carlos Eduardo Mello
On Feb 18, 2011, at 5:46 PM, mlist0...@gmail.com wrote: On Feb 18, 2011, at 11:20 AM, Carlos Eduardo Mello wrote: I need to declare an instance of MyDocument inside my view's classes. The compiler won't let me do this unless I import MyDocument to the class definitions. y

[Solved]: Trouble with design pattern

2011-02-19 Thread Carlos Eduardo Mello
*)event { if ([myViewDelegate respondsToSelector:@selector(myView:didMouseDown:) && ![myViewDelegate myView:self didMouseDown:theEvent]) { [super mouseDown:event]; } } I hope this is not too confusing. --Andy On Feb 18, 2011, at 02:20 PM, Carlos Eduardo Mello > wro

Problem opening file

2011-02-22 Thread Carlos Eduardo Mello
Hi there, I have a configuration file which is used by an internal library in my app's data model engine. The engine was written in c++ and needs this file for loading the app's documents correctly. Theis file never changes and shouldn't have to be seen or open by the user. Its contents

Re: Problem opening file

2011-02-22 Thread Carlos Eduardo Mello
On Feb 22, 2011, at 1:46 PM, Scott Ribe wrote: On Feb 22, 2011, at 9:14 AM, Sherm Pendley wrote: I imagine I have to deal with application bundle api, but the thing is I can't add any cocoa code to this library, as it needs remain cross-platform. Does this library allow you to specify the

Weird bug while debugging...

2011-02-23 Thread Carlos Eduardo Mello
Hi all, I've been trying to find an error in my code for the past two hours and my head is spinning. For some reason the debugger is acting reaally weird: - it doesn't show some of my local variables; - it goes through each line of code twice, before showing a variables value; - many va

Re: Weird bug while debugging...

2011-02-23 Thread Carlos Eduardo Mello
It sounds like you're trying to debug a "Release" configuration. Try debugging the "Debug" configuration instead. Ooops. Doooh! Of course. Sorry People. How stupid of me...and I should have realized it. Thanks a lot. (Please forgive me for the noise.) __

NSRuler for nonlinear measurements

2011-02-24 Thread Carlos Eduardo Mello
Hi everone, I am using a vertical NSRuler with my CustomView-inside-ScrollView set up. I read every piece of documentation there is (guides, reference) and searched the list archives and google but couldn't find anything to help me customize my rulers to be associated with data that does

NSRuler and non linear measurements

2011-02-25 Thread Carlos Eduardo Mello
(Sorry if you are receiving this message again, but since i got zero response the first time, i imagined it might not have been delivered...) Hi everone, I am using a vertical NSRuler with my CustomView-inside-ScrollView set up. I read every piece of documentation there is (guides, referenc

Help with simple NSView animation...

2011-02-26 Thread Carlos Eduardo Mello
Hi People, I am learning how to use a little core animation to make my user interface look cooler, but I am stuck with the following problem: I use a disclosure button do expand/contract a custom view which, in turn, is used to display an open bez-path. In the view's drawRect: I stroke t

Re: Help with simple NSView animation...

2011-03-03 Thread Carlos Eduardo Mello
Just in case someone was following... As I couldn't figure out a simple way to animate my view growing while drawing (my drawing needs to be updated for each step of the way, depending on the view's size...), as a workaround I hid the view out of sight by embeding it in a dumb transparent

Re: Help with simple NSView animation...

2011-03-03 Thread Carlos Eduardo Mello
do it with NSView calls without using layers, I mean, using the animator. I'll go through the Core Animation Guide to get a better handle on CALayer, etc. Thank You again for your time. On Mar 3, 2011, at 2:57 PM, Matt Neuburg wrote: On Thu, 03 Mar 2011 10:54:32 -0300, Carlos Edu

Re: Outlets Not Connected In awakeFromNib

2011-03-05 Thread Carlos Eduardo Mello
On Mar 5, 2011, at 4:00 PM, Matt Neuburg wrote: I'm not grasping where there can be any source of confusion here. awakeFromNib is very simple: it is sent to an object after that object is instantiated from a nib. That's straightforward and dependable and clear - provided you know what a ni

Question about user interface.

2011-03-10 Thread Carlos Eduardo Mello
Hi, I went over the OSX HIG but couldn't come up with a good solution for my input needs, so decided to ask the many experienced developers in here... In my app, the document window diplays a large canvas-type view in which various graphical objects are manipulated by the user. Each one

Re: Question about user interface.

2011-03-12 Thread Carlos Eduardo Mello
Quincey, Thanks for your help. I liked liked your idea a lot, specially the "thumb-button" for the graphical editor. The UI is comming out nicely. I really appreciate you taking the time to help me with design issues. Carlos. On Mar 10, 2011, at 10:06 PM, Quincey Morris wrote: - Then I t

setAlphaValue: and NSTextField

2011-03-12 Thread Carlos Eduardo Mello
Hi everybody, when I use the code bellow, the text inside my text field fades out ok. So do the rim and shadow, however the white rectangular shape of the field stays visible. Is this the expected behaviour? I thought setting the view's alpha to 0 would render it completely invisible...

Help with Custom Control

2011-03-23 Thread Carlos Eduardo Mello
Hi, I built a special control with a custom view and several parts, including standard controls and some subviews. The thing does special displaying and animation, and needs to be connected to other parts of the UI and to the document controller. The set up works very nicely. Isolating it

Re: Help with Custom Control

2011-03-25 Thread Carlos Eduardo Mello
If you're working with XCode 3.x, you can write an Interface Builder plugin for your custom view. I'm sure there are good tutorials online on how to create them. In XCode 4, however, IB plugins aren't yet supported. I am using 3.1.2, but what if I uograde to 4, would the plugin work be wa

Can't keep untitled windows from opening!

2011-03-31 Thread Carlos Eduardo Mello
Hi everyone, I've implemented both methods bellow, but my document-based app still opens untitled windows at start-up and when reactivated from the dock. The methods are placed in the window's delegate (MyDocument.m) but they never get called. Does anybody have an idea why this is happening

Re: Can't keep untitled windows from opening!

2011-03-31 Thread Carlos Eduardo Mello
Are you sure the window delegate is being set correctly and isn't nil? Yes. ___ 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)list

Re: Can't keep untitled windows from opening!

2011-03-31 Thread Carlos Eduardo Mello
Isn't the document subclass the app's delegate by default in the document architecture? On Mar 31, 2011, at 1:36 PM, Gary L. Wade wrote: These should be in the app delegate. - Gary L. Wade (Sent from my iPhone) On Mar 31, 2011, at 9:25 AM, Carlos Eduardo Mello > wrote:

Re: Can't keep untitled windows from opening!

2011-03-31 Thread Carlos Eduardo Mello
click the File's Owner (or the Application object) and see if it has a delegate. If so, that tells you what class you should be putting app delegate methods into. If not, you have to create a class -- typically a subclass of NSObject. --Andy On Mar 31, 2011, at 12:51 PM, Carlos

NSMutableArray contract

2011-04-01 Thread Carlos Eduardo Mello
Hi people, I just realized I may be doing something dangerous with an NSMutableArray. I searched Guides and References on this but couldn't find an explicit answer: - Does an NSMutableArray guarantee to retain an object on addObject:? - Does it ever make a copy of the original instead of re

Re: NSMutableArray contract

2011-04-01 Thread Carlos Eduardo Mello
Thanks for the confirmation. You can of course check that by logging the address of the object. I wonder what you're observing that makes you think this is the problem? The objects in this array are the main thing in my app. Various parts of the UI direct actions to each one of them, when

Re: textField - setIntegerValue

2011-04-04 Thread Carlos Eduardo Mello
On Apr 4, 2011, at 3:53 PM, JAMES ROGERS wrote: I am feeling really stupid. I have a simple textField set up in IB, nothing else, just a window with a textField. I have connected the textField to the outlet. I am new to this but, (just in case...) have you, by any chance, named a functio

Re: textField - setIntegerValue

2011-04-04 Thread Carlos Eduardo Mello
On Apr 4, 2011, at 7:09 PM, Kyle Sluder wrote: On Mon, Apr 4, 2011 at 2:26 PM, Carlos Eduardo Mello wrote: I am new to this but, (just in case...) have you, by any chance, named a function in your delegate as a setter for your outlet (setTextField:)? I fell into that trap a little while

Hot can I get called when my view scrolls?

2011-04-06 Thread Carlos Eduardo Mello
Hi, I have a custom view embeded in a scroll view (let's call it View A). I have another view (View B) which is related to View A (but not inside it) and needs to be updated whenever view A scrolls. (Please note that I don't have any problems with scrolling. Scrolling works great in Vie

Re: NSView behaves different on 10.4 vs 10.5?

2009-01-29 Thread Carlos Eduardo Mello
On Jan 29, 2009, at 12:56 AM, Jim Correia wrote: On Jan 28, 2009, at 9:44 PM, Adam Gerson wrote: "For performance reasons, Cocoa does not enforce clipping among sibling views or guarantee correct invalidation and drawing behavior when sibling views overlap." It is my understanding that this p

Re: Sound from scratch

2009-02-09 Thread Carlos Eduardo Mello
n I'd definetly go through the Csound tutorials and maybe even get RIchard Boulanger's Csound Book, and try to get a lot of familiarity with sound design concepts an techniques. I am sure by then lots of ideas will start to pop up. Good Luck, Carlos. ======== C

Re: Using NSRulerView with a non-text view

2009-02-16 Thread Carlos Eduardo Mello
Has anyone used NSRulerView with graphic or other non-text views? Nothing extensive - I've done some tests to learn NSRulerView and it seems to work fine with my custom NSViews. My client view is loaded from a nib per document. After nib is loaded, the ruler is set in MyDoument (below), wh

Re: Why does NSTextView move down?

2009-02-19 Thread Carlos Eduardo Mello
On Feb 19, 2009, at 5:08 PM, Eric Gorr wrote: If you edit the label of the item and enter enough characters so that it starts a third line, the NSTextView mysteriously shifts down a couple of pixels. It is unclear to me why this is happening and what I can do to prevent it. Any thoughts

Grow Bug ?

2008-11-17 Thread Carlos Eduardo Mello
Hi, Cocoa newbie here. I've been doing Carbon developing for a while, but just started to learn Cocoa. So, forgive me if my questions seem too dum. I was working on Hillgass's Custom Views tutorial (chapter 17, pg. 233). It involves drawing into a custom view which grows with the window.

Document based resource strategy

2008-11-23 Thread Carlos Eduardo Mello
Hi, Newbie questions here. I've been studying Hillegass's book and Apple's Guides and just started to prepare for implementing my own code. I know similar questions have been asked here recently but it I am still confused about it. Here it is: I am starting to write my app's GUI in Cocoa.

[Reposted] Document based resource strategy

2008-11-24 Thread Carlos Eduardo Mello
Hi, [ I'm reposting this since it apparently didn't go through the first time... ] Newbie questions here. I've been studying Hillegass's book and Apple's Guides and just started to prepare for implementing my own code. I know similar questions have been asked here recently but it I am st

Re: [Reposted] Document based resource strategy

2008-11-25 Thread Carlos Eduardo Mello
Thanks a lot for your reply. (for some reason I am not receiving my own posts, so I never know if they reached someone. Apparently yours was also the only response so far...) First off, the questions you are asking lead me to believe that you do not quite understand the document-based appl

Re: Newbie. Creating SubViews that aren't associated with NSWindow, or NSPanel?

2008-12-10 Thread Carlos Eduardo Mello
Maybe I 'm getting all this wrong, but from everything I read on this thread, apparently the OP wants to do something simple and is trying to do more work than necessary: "Now what I want to do is show/hide view1/view2 depending on which button you click. What I'm confused about is achieving

How to handle document scaling in an NSRulerView Client?

2008-12-12 Thread Carlos Eduardo Mello
Hi Everyone, my app has a view inside a scroll view with a horizontal ruler. When setting up the ruler I do the following: 1. call "setHasHorizontalRuler" 2. register my custom measurement unit with + "registerUnitWithName..." and select that unit in the ruler. 3. then I call "setRulersVi

Re: How to handle document scaling in an NSRulerView Client?

2008-12-13 Thread Carlos Eduardo Mello
On Dec 13, 2008, at 3:17AM, Dave Fernandes wrote: Not sure if I'm missing your point, but you can always call registerUnitWithName again with the new conversion factor after changing the view scale. With the same unit name? That's weird. Given the method name, and the fact that it's a

String Allocation inside drawRect:...

2009-04-15 Thread Carlos Eduardo Mello
Hi, I am calling the code below inside drawRect: in my custom view, so I can draw the string inside the view. It fails miserably every time. Is it, by any, chance illegal to allocate a string inside drawRect? Could anyone think of a reason twhy his call should just refuse to do its thing?

Re: Opening file with C++ iostream from application bundle

2009-04-19 Thread Carlos Eduardo Mello
Forgot...here is the file loading code bool ::LoadFromFile( string fileName, int which ) { ifstream fin; string temp, item; int itemCount, i; int lineCount = 0; fin.open( fileName.c_str() ); if(fin) { while( !fin.eof

Opening file with C++ iostream from application bundle

2009-04-20 Thread Carlos Eduardo Mello
Hi everyone, my Cocoa app (Objective-C++) works perfectly from within Xcode. However when I double click the application in Finder it does not load my data file.The file is a short text file which was placed next to the executable in the "build>Debug" or "build>Release" folders. It is loa