Re: Simple question? NSButton/checkbox color

2014-06-06 Thread Alex Kac
We’re a calendar app. Look at Apple’s calendar app :) https://www.dropbox.com/s/n2pizcdjsuzlk51/Screenshot%202014-06-06%2010.33.40.png That said, I’m not sold on the idea that this is the best way either…I have other ideas that I think are better than what Appel does, but as a last resort we wa

Re: Simple question? NSButton/checkbox color

2014-06-06 Thread Quincey Morris
On Jun 6, 2014, at 01:05 , Lee Ann Rucker wrote: > There's no supported way to do it and never has been I was able to do it — at least partially — in IB: — Select the checkbox — Display the “Core Animation Layer” tab of the inspector palette (the last icon on the right) — Check the box next

Re: Simple question? NSButton/checkbox color

2014-06-06 Thread Alex Kac
t; > To: "SevenBits" > Cc: "Cocoa-Dev" > Sent: Thursday, June 5, 2014 10:42:48 PM > Subject: Re: Simple question? NSButton/checkbox color > > OK maybe I’m not being clear. We need to have a checkbox that can be colored, > exactly the same way that the Cal

Re: Simple question? NSButton/checkbox color

2014-06-06 Thread Gary L. Wade
If I were colorizing such a button, I'd try overriding drawRect: and have the superclass draw in my own focused image, desaturate anything that's fully opaque (check boxes aren't necessarily rectangular nor "completely contained"), and then apply the desired color with a less-than-1.0 (25% maybe

Re: Simple question? NSButton/checkbox color

2014-06-06 Thread Lee Ann Rucker
;Alex Kac" To: "SevenBits" Cc: "Cocoa-Dev" Sent: Thursday, June 5, 2014 10:42:48 PM Subject: Re: Simple question? NSButton/checkbox color OK maybe I’m not being clear. We need to have a checkbox that can be colored, exactly the same way that the Calendar app on both co

Re: Simple question? NSButton/checkbox color

2014-06-05 Thread Alex Kac
OK maybe I’m not being clear. We need to have a checkbox that can be colored, exactly the same way that the Calendar app on both color their checkboxes for the calendar they are representing. Right now the only way I can think of doing that is to create a checkbox image, and color it, and use th

Re: Simple question? NSButton/checkbox color

2014-06-05 Thread Kyle Sluder
On Jun 5, 2014, at 5:38 PM, SevenBits wrote: > >> On Jun 5, 2014, at 8:32 PM, Alex Kac wrote: >> >> I’m still learning AppKit after many years on iOS :) >> >> Given an NSButton based checkbox…what’s the best way to get a colored check? >> I think we’re just going to have to use a custom image

Re: Simple question? NSButton/checkbox color

2014-06-05 Thread SevenBits
On Jun 5, 2014, at 8:32 PM, Alex Kac wrote: > I’m still learning AppKit after many years on iOS :) > > Given an NSButton based checkbox…what’s the best way to get a colored check? > I think we’re just going to have to use a custom image that we create - which > is fine just annoying as we’ll a

Simple question? NSButton/checkbox color

2014-06-05 Thread Alex Kac
I’m still learning AppKit after many years on iOS :) Given an NSButton based checkbox…what’s the best way to get a colored check? I think we’re just going to have to use a custom image that we create - which is fine just annoying as we’ll also have to match Yosemite - but if there is a better w

Re: Simple question about storyboard

2012-12-17 Thread Alex Kac
Storyboards are iOS 5+ only. On Dec 14, 2012, at 2:33 AM, Jingwei XU wrote: > Hi everyone, > I am a newbie in iOS field. I have a question about storyboard. If I > use storyboard in a project, is this project is not compatible for iOS > 4.3.3? > > Jingwei Xu Alex Kac - President and Foun

Simple question about storyboard

2012-12-17 Thread Jingwei XU
Hi everyone, I am a newbie in iOS field. I have a question about storyboard. If I use storyboard in a project, is this project is not compatible for iOS 4.3.3? Jingwei Xu -- ICS Group State Key Laboratory for Novel Software Technology Department of Computer Science and Technology Nanjing U

Re: Simple question driving me CRAZY

2012-06-16 Thread Dave DeLong
From http://developer.apple.com/library/mac/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226-CH1-SW17: > Which classes don’t support weak references? > You cannot currently create weak references to instances of the following > classes:

Simple question driving me CRAZY

2012-06-16 Thread Brad Stone
I have a subclass of a NSViewController. In fact, I created on just as a test with no custom code. I then throw an NSTextView in the NSView that comes with it and then drag from the NSTextView to the .h file to create an outlet. Why why why is it making it unsafe_unretained? I'm using ARC.

Re: Simple question

2010-04-22 Thread Quincey Morris
On Apr 22, 2010, at 10:21, Arnold Nefkens wrote: > Yeah the keys are ints and this helps a lot. > > Thanks again... > > On 22 apr 2010, at 18:31, Reinhard Segeler wrote: > >> Hi, >> >> correct me if I'm wrong, but what you're doing is a calculation with the >> pointers ( * of NSNumber) not th

Re: Simple question

2010-04-22 Thread James Montgomerie
You should really use 'integerValue' rather than 'intValue' if you're otherwise using NSIntegers. 'integerValue' will return an NSInteger (which may be 32 or 64 bits wide depending on your platform), but 'intValue' will return a C 'int' (which is always 32 bit on the Mac and iPhone, regardless

Re: Simple question

2010-04-22 Thread banane
This is an interesting exercise! I would extract the values of the fields, manipulate them, then assign the contents of Field4 with the answer: int val1 = [managedObject valueForKey:@"key1"] // etc. for each user entry field1-3 int val4 = val1 + etc. // equation with final assignment to value4 (n

Re: Simple question

2010-04-22 Thread Arnold Nefkens
Hi Thanks Yeah the keys are ints and this helps a lot. Thanks again... On 22 apr 2010, at 18:31, Reinhard Segeler wrote: > Hi, > > correct me if I'm wrong, but what you're doing is a calculation with the > pointers ( * of NSNumber) not the values. You have to calculate it like this: > > NSI

Re: Simple question

2010-04-22 Thread jonat...@mugginsoft.com
On 22 Apr 2010, at 17:09, Graham Cox wrote: > > On 23/04/2010, at 1:59 AM, k...@highrolls.net wrote: > >> Try this: > > > Looks equally incorrect to me. The problem is that NSNumbers are not NUMBERS. > If the OP has prior experience with c++ and operator overloading then their confusion migh

Re: Simple question

2010-04-22 Thread Reinhard Segeler
Hi, correct me if I'm wrong, but what you're doing is a calculation with the pointers ( * of NSNumber) not the values. You have to calculate it like this: NSInteger fieldOne = [ [ managedObject valueForKey:@"key1"] intValue]; // if it's an integer NSInteger fieldTwo = [ [ managedOb

Re: Simple question

2010-04-22 Thread koko
Ok. I was just putting answer in a broader scope as the OP indicated that was the problem. I see I must look into NSNumber ... Thx ! -koko On Apr 22, 2010, at 10:11 AM, Graham Cox wrote: On 23/04/2010, at 1:59 AM, k...@highrolls.net wrote: Try this: Looks equally incorrect to me. Th

Re: Simple question

2010-04-22 Thread Graham Cox
On 23/04/2010, at 1:59 AM, k...@highrolls.net wrote: > Try this: Looks equally incorrect to me. The problem is that NSNumbers are not NUMBERS. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

Re: Simple question

2010-04-22 Thread koko
Try this: NSNumber *fieldOne = [managedObject valueForKey:@"key1"]; NSNumber *fieldTwo = [managedObject valueForKey:@"key2"]; NSNumber *fieldThree = [managedObject valueForKey:@"key3"]; NSNumber *answer; if (fieldTwo > 0) { answer = ((fieldTwo - fieldOne) + fieldThree); [self.m

Re: Simple question

2010-04-22 Thread Graham Cox
On 23/04/2010, at 1:36 AM, Arnold Nefkens wrote: > NSNumber *fieldOne = [managedObject valueForKey:@"key1"]; > NSNumber *fieldTwo = [managedObject valueForKey:@"key2"]; > NSNumber *fieldThree = [managedObject valueForKey:@"key3"]; > if (fieldTwo > 0) { > NSNumber *answer = ((fieldTwo - fiel

Simple question

2010-04-22 Thread Arnold Nefkens
Hello list, Im quite new, and probably missing something. I want to do a calculation of three fields inside of a entity in CoreData. Below is the code, what is wrong? NSNumber *fieldOne = [managedObject valueForKey:@"key1"]; NSNumber *fieldTwo = [managedObject valueForKey:@"key2"]; NSNumber *f

Re: Simple question on Menus and Document-based apps

2009-12-21 Thread Sherm Pendley
2009/12/21 Henri Häkkinen : > > So I have a simple document-based application which has MyDocument with some > other classes. The application has the default MainMenu.xib and > MyDocument.xib interface files. I would like to add a menu item to the > MainMenu, which would call an IBAction method

Simple question on Menus and Document-based apps

2009-12-21 Thread Henri Häkkinen
Hello. This is probably a basic question but I haven't been able to find an answer from the ADC guides so far. So I have a simple document-based application which has MyDocument with some other classes. The application has the default MainMenu.xib and MyDocument.xib interface files. I would li

Re: simple question about variable retain/release (NSDate)

2008-11-21 Thread Andrew Farmer
On 21 Nov 08, at 18:17, Bob Sabiston wrote: Hi, I have a newbie question about retain/release stuff when using NSDate. I am confused a little about what is necessary in this case. I've got a local variable sTime (NSDate *). I use it to measure the time and then compare it to the current

simple question about variable retain/release (NSDate)

2008-11-21 Thread Bob Sabiston
Hi, I have a newbie question about retain/release stuff when using NSDate. I am confused a little about what is necessary in this case. I've got a local variable sTime (NSDate *). I use it to measure the time and then compare it to the current time, so that I can space out an animation

Re: simple question about passing around pointers to objects

2008-06-27 Thread Graham Cox
Actually, in the context of this: NSArray *a = [NSArray arrayFromObjects:someObject, anotherObject, nil]; you would do nothing, since that method returns an autoreleased NSAarray already. But in a situation where you alloc/inited an object, you would autorelease before returning it. G

Re: simple question about passing around pointers to objects

2008-06-27 Thread Graham Cox
Then you'd be wrong. You should use [a autorelease]; G. On 28 Jun 2008, at 10:19 am, Daniel Richman wrote: I would use [a retain]; ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: simple question about passing around pointers to objects

2008-06-27 Thread Clark Cox
On Fri, Jun 27, 2008 at 5:19 PM, Daniel Richman <[EMAIL PROTECTED]> wrote: > >> Here is a simple example: >> >> -(NSArray*) makeObject { >>NSArray *a = [NSArray arrayFromObjects];someObject, anotherObject, >> nil]; > > This should be NSArray *a = [NSArray arrayFromObjects:someObject, > anotherO

Re: simple question about passing around pointers to objects

2008-06-27 Thread Daniel Richman
Here is a simple example: -(NSArray*) makeObject { NSArray *a = [NSArray arrayFromObjects];someObject, anotherObject, nil]; This should be NSArray *a = [NSArray arrayFromObjects:someObject, anotherObject]; // should I [a retain]; I would use [a retain]; // or [a release]; /

Re: simple question about passing around pointers to objects

2008-06-27 Thread Rob Ross
The details of memory management take a long time to understand fully, but there are some basic simple principles that will really help you out. 1. When you get an object from a method that starts with "alloc" or "new", or contains the word "copy" in it, YOU own that object. The retain co

Re: simple question about passing around pointers to objects

2008-06-27 Thread Andy Lee
On Jun 27, 2008, at 4:22 PM, Paul Archibald wrote: I am reading the Hillegass book, but I don't really see an example of what I am tryng to do, although it seems like a very basic question. [...] But, as I have been trying to make an exhaustive test of what "works" and what "crashes", I rea

simple question about passing around pointers to objects

2008-06-27 Thread Paul Archibald
Comrades: I have experimented a bit with this, and I think I have something that works, but I would like to understand it better. I am reading the Hillegass book, but I don't really see an example of what I am tryng to do, although it seems like a very basic question. The Question: If I w

Re: Simple question - Subclassing NSView

2008-06-12 Thread Andy Lee
On Jun 12, 2008, at 2:20 PM, I. Savant wrote: NSRectFill() is a C function, not part of any class e.g. NSView. aRect is simply a struct which specify location points (doesnt contain reference of any window). How the function knows about the drawing surface, in which window/surface to paint?

Re: Simple question - Subclassing NSView

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 10:54 AM, Vikas wrote: How the function knows about the drawing surface, in which window/ surface to paint? There's always a current graphics context; it's global to each thread. (See NSGraphicsContext if you want to look at its API; but if you're looking for the low-lev

Re: Simple question - Subclassing NSView

2008-06-12 Thread Mike Abdullah
On 12 Jun 2008, at 10:54, Vikas wrote: O'kay, that was helpful. I still have one doubt. The declaration of NSRectFill is as below: void NSRectFill ( NSRect aRect ); NSRectFill() is a C function, not part of any class e.g. NSView. aRect is simply a struct which specify location points (d

Re: Simple question - Subclassing NSView

2008-06-12 Thread Kyle Sluder
On Thu, Jun 12, 2008 at 1:54 PM, Vikas <[EMAIL PROTECTED]> wrote: > NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which >

Re: Simple question - Subclassing NSView

2008-06-12 Thread I. Savant
> NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which > window/surface to paint? Does it implicitly make use of some self

Re: Simple question - Subclassing NSView

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 6:54 PM, Vikas <[EMAIL PROTECTED]> wrote: > NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which > win

Re: Simple question - Subclassing NSView

2008-06-12 Thread Vikas
O'kay, that was helpful. I still have one doubt. The declaration of NSRectFill is as below: void NSRectFill ( NSRect aRect ); NSRectFill() is a C function, not part of any class e.g. NSView. aRect is simply a struct which specify location points (doesnt contain reference of any wind

Re: Simple question - Subclassing NSView

2008-06-12 Thread I. Savant
> I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. Recant, heretic! ;-) > In first line, I was expecting something like [self setColor:[NSColor > blackColor]]; (similar to this.color = NSColor.blackColor; in C#/C++) > how NSColor ob

Re: Simple question - Subclassing NSView

2008-06-12 Thread Shawn Erickson
On Thu, Jun 12, 2008 at 10:26 AM, Vikas <[EMAIL PROTECTED]> wrote: > Hi, > > I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. So, its a fairly basic question. Please help me > understand the following code: > > @implementation MyView /

Re: Simple question - Subclassing NSView

2008-06-12 Thread Hamish Allan
Hi Vikas, On Thu, Jun 12, 2008 at 6:26 PM, Vikas <[EMAIL PROTECTED]> wrote: > I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. So, its a fairly basic question. Please help me > understand the following code: > > @implementation MyView

Re: Simple question - Subclassing NSView

2008-06-12 Thread Randall Meadows
On Jun 12, 2008, at 10:26 AM, Vikas wrote: I have recently started programming on Mac using Objective-C and Cocoa. I am coming from C++/C# world. So, its a fairly basic question. Please help me understand the following code: @implementation MyView /*MyView inherits from NSView */ -(v

Simple question - Subclassing NSView

2008-06-12 Thread Vikas
Hi, I have recently started programming on Mac using Objective-C and Cocoa. I am coming from C++/C# world. So, its a fairly basic question. Please help me understand the following code: @implementation MyView /*MyView inherits from NSView */ -(void)drawRect: (NSRect)aRect {

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

2008-03-18 Thread Sherm Pendley
On Tue, Mar 18, 2008 at 1:02 PM, Scott Thompson <[EMAIL PROTECTED]> wrote: > > 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, Objec

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 wh

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

2008-03-17 Thread Sherm Pendley
On Mon, Mar 17, 2008 at 2:39 PM, Paul Sargent <[EMAIL PROTECTED]> wrote: > > On 17 Mar 2008, at 17:46, Hamish Allan wrote: > > > If you're cutting your programming teeth on Cocoa, you might find that > > Python or Ruby is gentler. > > I'm not sure I agree. Two problems for me. > > * Cocoa isn't a

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

2008-03-17 Thread Paul Sargent
On 17 Mar 2008, at 17:46, Hamish Allan wrote: If you're cutting your programming teeth on Cocoa, you might find that Python or Ruby is gentler. I'm not sure I agree. Two problems for me. * Cocoa isn't a seamless fit with either python or ruby, so there are little corner cases around that d

Re: Simple question

2008-03-17 Thread Hamish Allan
On Mon, Mar 17, 2008 at 2:56 PM, Rob Napier <[EMAIL PROTECTED]> wrote: > While K&R is certainly the gold standard reference, I wouldn't > recommend it as the book to learn the language. I thought K&R was great for learning C, but unlike the OP, I had programmed in other languages (e.g. assembler

Re: Simple question

2008-03-17 Thread Gregory Weston
Rob Napier wrote: After that one, I recommend Aaron Hillegass's "Cocoa Programming for Mac OS X" which was recently discussed on this list. It assumes a background in C or Objective-C, but is the best book for learning Cocoa. Seconded, with the caveat that the 3rd edition is apparently exp

Re: Simple question

2008-03-17 Thread Rob Napier
While K&R is certainly the gold standard reference, I wouldn't recommend it as the book to learn the language. Kochan's "Programming in Objective-C" as noted by Rob Keniger is a much better introduction to what you'll need for programming on a Mac. After that one, I recommend Aaron Hillegass's "Coc

Re: Simple question

2008-03-17 Thread Kyle Sluder
On Mon, Mar 17, 2008 at 9:33 AM, Scott Thompson <[EMAIL PROTECTED]> wrote: > I would recommend that you find a nice book on C. I would recommend > one, but it's been a while since I've surveyed the literature. Get "The C Programming Language" by Kernighan and Ritchie. It is the gold standard o

Re: Simple question

2008-03-17 Thread Rob Keniger
On 17/03/2008, at 11:33 PM, Scott Thompson wrote: I would recommend that you find a nice book on C. I would recommend one, but it's been a while since I've surveyed the literature. I highly recommend "Programming in Objective-C" by Stephen Kochan. IMO it is by far the best introduction to

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

RE: Simple question

2008-03-17 Thread Luca Ciciriello
C++ language. Luca. > From: [EMAIL PROTECTED] > To: Cocoa-dev@lists.apple.com > Date: Tue, 18 Mar 2008 00:45:17 +1300 > CC: > Subject: Simple question > > I have studying Cocoa - objective-C by myself for a few days ( im > entirely new to programming). There's a

Simple question

2008-03-17 Thread Cocoa
I have studying Cocoa - objective-C by myself for a few days ( im entirely new to programming). There's a question I wanna know about. When you create a project in XCode, and add a new class, does anyone know what .h file and .m respectively for? I mean if they have their own jobs in the co