Querying system-wide base for file size calculation (base-2 vs base-10)

2011-11-23 Thread Oleg Krupnov
Hi, Previously, I've been using a simple switch: use 10-based for 10.6 and later, and 2-based for earlier versions of the Mac OS X, but I've learned that there are some utilities (e..g switchDiskSizeBase, see http://web.me.com/brkirch/brkirchs_Software/switchDiskSizeBase/switchDiskSizeBase.html) t

Problem getting NSTextView Ruler to update

2011-11-23 Thread Marshall Houskeeper
I am attempting to programmatically setup the tabs for a simple NSTextView view. I need to have the entire NSTextView use the same tab stops. I set the tabs with the following code: void Write_Tabs(NSArray* tabs, NSTextView* text_view) { NSMutableParagraphStyle *paragraph_style =

Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Gilles Celli
Hello, I've setup an NSOutlineView with 2 colums: the first one named "buttonColumns" with NSButtonCell (Switch ON / OFF) and the second one with TextFieldCell… While the state change works for NSButtonCell in the buttonColum I had to create an NSArray *checks to set it ON or OFF. Is there an e

Re: Weird NSTextField behavior on MBA.

2011-11-23 Thread Gustavo Pizano
Ok so its fixed. Interestingly setting the textfiield.stringvalue wasn't working. But when I set the textfield.floatValue it did work normally on all machines. gustavo On Nov 22, 2011, at 2:37 PM, Richard Somers wrote: > On Nov 22, 2011, at 1:59 AM, Gustavo Pizano wrote: > >> I will make s

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Lee Ann Rucker
How about just a C array? If NBR_OF_ROWS is a constant, BOOL checks[NBR_OF_ROWS]; otherwise malloc it. Although I'd be more likely to have an array of data objects with a BOOL and whatever goes in the text field, just to keep the two values together and allow for reordering, variable sized ar

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Quincey Morris
On Nov 23, 2011, at 07:58 , Gilles Celli wrote: > I've setup an NSOutlineView with 2 colums: the first one named > "buttonColumns" with NSButtonCell (Switch ON / OFF) > and the second one with TextFieldCell… > > While the state change works for NSButtonCell in the buttonColum I had to > create

Re: Querying system-wide base for file size calculation (base-2 vs base-10)

2011-11-23 Thread Jens Alfke
On Nov 23, 2011, at 5:28 AM, Oleg Krupnov wrote: > Previously, I've been using a simple switch: use 10-based for 10.6 and > later, and 2-based for earlier versions of the Mac OS X, but I've > learned that there are some utilities (e..g switchDiskSizeBase, see > http://web.me.com/brkirch/brkirchs_

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Gilles Celli
Thanks for quick repliesthings are a little more clear now, so I will stick with the NSArray version. Just a question at Quincey: Maybe it's me, but I'm not sure how I could convert the 'item' parameter of both NSOutlineView datasource methods to a row number ? Where should I get the index

Re: Querying system-wide base for file size calculation (base-2 vs base-10)

2011-11-23 Thread Oleg Krupnov
Yes, I checked the source code of switchDiskSizeBase, and as far as I can see, the guy is using some low-level hack, like opening a system framework binary, uncompress it, find some bytes at certain magic offset, read and rewrite them. This kind of thing isn't acceptable for my app, I'm looking for

Re: Querying system-wide base for file size calculation (base-2 vs base-10)

2011-11-23 Thread Jens Alfke
On Nov 23, 2011, at 1:08 PM, Oleg Krupnov wrote: > Yes, I checked the source code of switchDiskSizeBase, and as far as I > can see, the guy is using some low-level hack, like opening a system > framework binary, uncompress it, find some bytes at certain magic > offset, read and rewrite them. This

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Quincey Morris
On Nov 23, 2011, at 12:40 , Gilles Celli wrote: > Just a question at Quincey: Maybe it's me, but I'm not sure how I could > convert the 'item' parameter of both NSOutlineView datasource methods to a > row number ? Where should I get the index value ? [outlineView rowForItem: item] ___

Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView

2011-11-23 Thread Quincey Morris
On Nov 23, 2011, at 12:40 , Gilles Celli wrote: > things are a little more clear now, so I will stick with the NSArray version. Actually, I gave you a partially wrong answer. I noticed you are using a NSOutlineView, but then I forgot to take into account the list hierarchy. In general, trying t