Re: best time to alter GUIs

2008-02-29 Thread Quincey Morris


On Feb 28, 2008, at 21:04, Daniel Child wrote:

In other words, the window loads right away. I actually don't want  
it to load until I have set the local data, as it is the local data  
that will determine how the window should appear. Is there a way to  
sneak the data in in before all the loading takes place?


Are you sure "Visible at launch" isn't checked for the window in IB?

Note that it's ultimately not important whether you give the "local  
data copy" to the window controller before or after the window is  
loaded. You can't actually modify the window until after it's loaded.

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Compilation: error on linking libcurl PPC 7.18 on my Cocoa project

2008-02-29 Thread Michaël Parrot

Hello,

To start portage of winwin project to Mac OS X I need to use the  
library libcurl 7.18 but the build faild on PPC link.


I downloaded two binaries from 
http://www.hmug.org/pub/MacOS_X/BSD/Applications/Internet/curl/
since the page http://curl.haxx.se/download.html

(Unfortunately, no Universal 7.18 build for moment...).

After, I use lipo to create UB at add this new UB into my project  
(file command confirm the ppc and i386 architectures).

But on link from xCode, It fail on linking the ppc target.

After basic operations (Clean All, checking Header files) I want to  
compile my project in PPC only with the downloaded PPC binary... but  
also not works !


I try all the day, testing the UB 7.16 version by Apple and this great  
work (but I need to use the 7.18).


I downloaded the source of 7.18 and make compilation with added gcc  
option -arch ppc to make (and confirm by file command) the ppc binary  
but It always fail...


What omit ? Where can search ? Thanks a lot everybody.

Test files
http://mic3d.free.fr/TesteurPPCIntel.zip

Michaël Parrot.

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Scripting Bridge & Mail

2008-02-29 Thread Peter Schmidt
Hello List,

I'm trying to generate an Email via Apple Scripting Bridge. Everything works 
fine, but can't add an attachment to it. I had tryed several ways, but it 
doesn't work. Can anybody help me to get it work?

Here ist a code snippet:

AppleMailApplication *mail = [SBApplication 
applicationWithBundleIdentifier: @"com.apple.mail"];
AppleMailOutgoingMessage *message = [[[mail classForScriptingClass: 
@"outgoing message"] alloc] init];

NSDictionary *path = [NSDictionary dictionaryWithObject: 
@"Merkur:Users:schmidt:Desktop:image.tiff" forKey: @"file name"]; 
[[mail outgoingMessages] addObject: message];

[message setSubject: @"This is my subject";
[message setContent: @"This ist my content";
[message setVisible: YES];

   // This doesn't work, but I don't not why.
AppleMailAttachment *attachment = [[[mail classForScriptingClass: 
@"attachment"] alloc] initWithProperties: path];
[[[message content] attachments] addObject: attachment];
// [attachment setFileName: 
@"Merkur:Users:schmidt:Desktop:DiscItemDisc.tiff"];

[mail activate];


Thanks so far,
Peter
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Better Anti-Aliasing for drawing?

2008-02-29 Thread Jean-Daniel Dupas


Le 29 févr. 08 à 10:50, Ben Lachman a écrit :

I have some stuff that I draw rotated a small amount (~10 degrees)  
and the lines looks a little bit chunky for my tastes.  You can see  
an example at: .


Is there any way to coax better antialiasing out of drawing things  
at this small an angle?


Thanks,
->Ben
--
Ben Lachman
Acacia Tree Software



Try this:

[[NSGraphicsContext currentContext]  
setImageInterpolation:NSImageInterpolationHigh];


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Better Anti-Aliasing for drawing?

2008-02-29 Thread Ben Lachman
I have some stuff that I draw rotated a small amount (~10 degrees)  
and the lines looks a little bit chunky for my tastes.  You can see  
an example at: .


Is there any way to coax better antialiasing out of drawing things at  
this small an angle?


Thanks,
->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

[EMAIL PROTECTED]
740.590.0009



___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Charting API?

2008-02-29 Thread lbland

On Feb 27, 2008, at 2:14 PM, Chris Schmitt wrote:

I want to add some simple bar graphs and pie charts to my project.   
Is there an apple api for charting or do you need to use a 3rd  
party product?


hi-

You can use Vvidget Code (http://www.vvi.com/products/vvidgetcode)  
which now has an IB 3.0 palette and a four-way framework for Leopard  
(http://www.vvi.com/news/2008/0215vvidget.html) .


thanks!-

-lance

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 321

2008-02-29 Thread Daniel Child

Visible at launch is not checked.

But are you suggesting that you cannot configure the window prior to  
displaying it? Or do you distinguish "load" from "display"? I'm  
trying to load it into memory, alter it, and then display.


Judging from debug sessions, the window and other top level objects  
(not to mention all the outlets) only come to life (get their  
addresses assigned) on entering awakeFromNib.


On Feb 29, 2008, at 8:57 AM, [EMAIL PROTECTED] wrote:


In other words, the window loads right away. I actually don't want
it to load until I have set the local data, as it is the local data
that will determine how the window should appear. Is there a way to
sneak the data in in before all the loading takes place?


Are you sure "Visible at launch" isn't checked for the window in IB?

Note that it's ultimately not important whether you give the "local
data copy" to the window controller before or after the window is
loaded. You can't actually modify the window until after it's loaded.


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Charting API?

2008-02-29 Thread Jiva DeVoe
I'll add my recommendation for SM2DGraphView as well. The docs are  
good and the code works well.


--
Jiva DeVoe
http://www.random-ideas.net

On Feb 27, 2008, at 4:56 PM, "Kyle Sluder" <[EMAIL PROTECTED] 
> wrote:


On Wed, Feb 27, 2008 at 2:14 PM, Chris Schmitt <[EMAIL PROTECTED]>  
wrote:
I want to add some simple bar graphs and pie charts to my project.   
Is

there an apple api for charting or do you need to use a 3rd party
product?


Apple's framework is private.  I've been toying with SM2DGraphView,
it's pretty nice:
http://developer.snowmintcs.com/frameworks/sm2dgraphview/

--Kyle Sluder
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jiva%40devoesquared.com

This email sent to [EMAIL PROTECTED]


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scripting Bridge & Mail

2008-02-29 Thread Manfred Schwind
   NSDictionary *path = [NSDictionary dictionaryWithObject:  
@"Merkur:Users:schmidt:Desktop:image.tiff" forKey: @"file name"];


The string used in this dictionary is not a valid file path. In this  
case it should be e.g.:


@"/Users/schmidt/Desktop/image.tiff"

or even better:

[NSHomeDirectory() stringByAppendingPathComponent:@"Desktop/ 
image.tiff"];


Regards,
Mani
--
http://www.mani.de
iVolume - Loudness adjustment for iTunes.
LittleSecrets - The encrypted notepad.


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scripting Bridge & Mail

2008-02-29 Thread Peter Schmidt


Am 29.02.2008 um 14:55 schrieb Manfred Schwind:


@"/Users/schmidt/Desktop/image.tiff"

or even better:
[NSHomeDirectory() stringByAppendingPathComponent:@"Desktop/ 
image.tiff"];


The Path is not the problem (the hardcoding is only for testing). If  
I'm trying to set it path after addig the attachment, the error log  
says that the object isn't assigned to a container.

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Determining NSTableView height when doing layout in IB

2008-02-29 Thread Sean McBride
Hi all,

Is it just me, or does IB not really provide a way to nicely set the
height of a tableview?  I would like for my tableviews to have a height
such that an integer number of rows fit, without any half rows visible.
Something like:

height of scroll view containing tableview = height of table header view
+ (num rows * row height) + height of horizontal scroller.

If I resize the height of a tableview in IB, I don't get any guide marks
(dotted blue lines).  Given that IB can't do this (or can it?), is my
little formula above correct?

Thanks,

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Determining NSTableView height when doing layout in IB

2008-02-29 Thread Kyle Sluder
On Fri, Feb 29, 2008 at 11:09 AM, Sean McBride <[EMAIL PROTECTED]> wrote:
>  height of scroll view containing tableview = height of table header view
>  + (num rows * row height) + height of horizontal scroller.

I think the biggest problem with this would be implementing this logic
for any arbitrary view.  Though it would most certainly be nice.  File
a bug, maybe it'll happen (along with the restoration of all the
guides we lost from IB2... *grumble*).

--Kyle Sluder
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: CATextLayer metrics

2008-02-29 Thread Scott Anguish
CATextLayer is largely a convenience class.  It provides text  
features, but very little flexibility.


You can easily subclass CALayer and create your own text layer that  
uses NSFont, complex text layout , and all the familiar methods.  Plus  
you'll get more flexibility.





___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


No Undo in RubyCocoa CoreData apps?

2008-02-29 Thread Knud Hinnerk Möller

Hi,

I've asked this question in other places, but didn't get a good answer  
yet. So: if you create a basic ObjC coredata app from the appropriate  
template in XCode, you'll get undo support, as promised. If you create  
the same application with RubyCocoa (using the XCode template again),  
you don't. Are there some settings I need to set before undo support  
works? Or is this a bug in RubyCocoa?


Someone suggested that the undo menu item might not be hooked up to  
FirstResponder in the RubyCocoa template, but that is not the case.


I have also filed a bug about this with Apple (5771216)

Overall, it's great to have Ruby support for Cocoa, but in some places  
it's still a little shaky.


Cheers,
Knud

-
Knud Möller, MA
+353 - 91 - 495086
Smile Group: http://smile.deri.ie
Digital Enterprise Research Institute
  National University of Ireland, Galway
Institiúid Taighde na Fiontraíochta Digití
  Ollscoil na hÉireann, Gaillimh

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSTableView

2008-02-29 Thread Jeremy

John,

I guess I forgot to send an e-mail saying Andrew Merenbach helped me  
out on this one. He found a small error in my code. :)


Jeremy
"For a long time it puzzled me how something so expensive, so leading  
edge, could be so useless, and then it occurred to me that a computer  
is a stupid machine with the ability to do incredibly smart things,  
while computer programmers are smart people with the ability to do  
incredibly stupid things. They are, in short, a perfect match." - Bill  
Bryson



On Feb 29, 2008, at 10:47 AM, Jonathan Dann wrote:


Jeremy,

Send it this way mate. I'll have a look. You on iChat? I'll screen  
share it with you if you run leopard. Might solve your problem  
quicker! [EMAIL PROTECTED]


Jonathan Dann

On 29 Feb 2008, at 00:55, Jeremy <[EMAIL PROTECTED]> wrote:

OK. Now with connecting it in IB it stills seems to be not working.  
I have made those changes that you said and nick also stated. :)  
But I am still getting a blank NSTableView. If those changes make  
it so that my code SHOULD work, I have no Idea why it isn't  
working... If you would like a copy of my project just send me a  
direct e-mail and I will send it.


Jeremy
"For a long time it puzzled me how something so expensive, so  
leading edge, could be so useless, and then it occurred to me that  
a computer is a stupid machine with the ability to do incredibly  
smart things, while computer programmers are smart people with the  
ability to do incredibly stupid things. They are, in short, a  
perfect match." - Bill Bryson



On Feb 28, 2008, at 7:52 PM, Andrew Merenbach wrote:


Hi, Jeremy,

You appear to have a few corrections that need to be made with  
your code.  To resolve these will help you on your way.  You  
should make the following changes before you try to get things  
working:


1. Remove the extraneous retain from your categoriesArray  
instantiation -- -alloc and -init produce a retained object.

2. Change:


NSString *string;
string = [NSString init];
string = @"Main Category";


to

NSString *string = @"Main Category";

  or

NSString *string = [NSString stringWithString:@"Main Category"];

3. Also note that [NSString init] is improper; you need [[NSString  
alloc] init] or [NSString string] -- but no matter what, it's a  
waste if you immediately set string to @"Main Category".


4. Is your controller class with the code that you gave all set up  
as the dataSource for the table view?  You'll need to connect that  
in Interface Builder.


If I can be of any more service, let me know.

Cheers,
  Andrew

On Feb 28, 2008, at 4:41 PM, Jeremy wrote:


This is how I am attempting to do it...

In awakeFromNib:

  categoriesArray = [[[NSMutableArray alloc] init] retain];
  NSString *string;
  string = [NSString init];
  string = @"Main Category";
  [categoriesArray addObject:string];
  [categories selectRow:1 byExtendingSelection:NO];
  [categories scrollRowToVisible:1];

And my informal protocols:

- (int)numberOfRowsInTableView:(NSTableView *)aTableView
{
  return [categoriesArray count];
}

- (id)tableView:(NSTableView *)aTableView objectValueForColumn: 
(NSTableColumn *)aTableColumn row:(int)row

{
return [categoriesArray objectAtIndex:row];
}

The NSTableView is not being populated at all... No rows, and  
nothing else


Jeremy
"For a long time it puzzled me how something so expensive, so  
leading edge, could be so useless, and then it occurred to me  
that a computer is a stupid machine with the ability to do  
incredibly smart things, while computer programmers are smart  
people with the ability to do incredibly stupid things. They are,  
in short, a perfect match." - Bill Bryson



On Feb 28, 2008, at 7:39 PM, Hamish Allan wrote:

On Fri, Feb 29, 2008 at 12:34 AM, Jeremy  
<[EMAIL PROTECTED]> wrote:


I am trying to figure NSTableViews out. I have two table views  
inside
of my window. The code I have is completely useless and not  
working.
Can anyone explain how to populate an NSTableView using arrays?  
If you

could that would be greatly appreciated.


You should explain how what you are trying to do differs from  
what is

covered in the various basic tutorials for using NSTableViews;
otherwise we will not know how to address your question.

Hamish


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/andrew.merenbach%40ucla.edu

This email sent to [EMAIL PROTECTED]




___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/j.p.dann%40gmail

Re: TextEdit-speed file loading

2008-02-29 Thread Douglas Davidson


On Feb 28, 2008, at 8:26 PM, Steven Degutis wrote:


I've manually set that to YES using IB3, and it did make a significant
difference in loading time, pretty close to the near-instant time of
TextEdit. However, when I try to scroll through the NSTextView using
the scroll bar, it often becomes unresponsive. I'm assuming this is
because only at that point is it rendering the layout for every
section I scroll past, which would make sense. Though, TextEdit
doesn't show this same behavior. So, I think it's a step closer!


TextEdit's source is all there for you to look at--it just uses  
standard NSTextViews.  It's difficult for us to tell without more  
information what settings you may have on your text views that might  
be different from what TextEdit is using, but you should be able to  
get the behavior of TextEdit in your application, if necessary by  
copying its code.


Douglas Davidson

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Determining NSTableView height when doing layout in IB

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 08:09, Sean McBride wrote:


Is it just me, or does IB not really provide a way to nicely set the
height of a tableview?  I would like for my tableviews to have a  
height
such that an integer number of rows fit, without any half rows  
visible.


You can always turn on alternating row colors, resize to eliminate  
partial rows, then turn alternating rows off again. :)



___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Cocoa-dev Digest, Vol 5, Issue 321

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 06:09, Daniel Child wrote:

But are you suggesting that you cannot configure the window prior to  
displaying it? Or do you distinguish "load" from "display"? I'm  
trying to load it into memory, alter it, and then display.




I was distinguishing "load" from "display". You had said that the  
window was getting loaded too early, and my point was that you  
wouldn't care exactly when the window got loaded, just so long as you  
could change it before it was displayed. Did you mean to say that the  
window got displayed too early?



___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scripting Bridge & Mail

2008-02-29 Thread has

Peter Schmidt wrote:

I'm trying to generate an Email via Apple Scripting Bridge.  
Everything works fine, but can't add an attachment to it.


The AttachToMail sample project in appscript's svn repository shows  
how to do this using objc-appscript.


http://appscript.sourceforge.net/objc-appscript.html

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Fixed Column in TableView?

2008-02-29 Thread Jerry LeVan

Hi,

I could not find much in the archives...

There have been several occasions where it would have been
very convenient to be able to pin the first column in
a table view.

I.e. looking at a wide table in a database where the
first column is a key value...

Has anyone figured out a way to keep the first column of a tableview
from scrolling out of sight when horizontal scrolling
is done?

Thanks,

Jerry
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Returning values from objc_msgSend etc

2008-02-29 Thread Duncan McGregor
Are there any Objective-C wizards out there who could review a few
conceptual and practical issues I have returning values from
objc_msgSend and its friends?

I've just released Rococoa, a generic replacement for the Cocoa-Java
bridge, under LGPL. Some things do not work as expected on PPC. I know
I really need to understand how objc_msgSend works, but cannot find a
complete discussion anywhere.

In short, my questions are

* If both objc_msgSend_stret and objc_msgSend hack the stack to return
different sized return values, why are there 2 functions?
* Should I call objc_msgSend_stret when returning longs on PPC?
* Do I really need to call objc_msgSend_fpret for floating point on Intel?

In long, my understanding of the issue is set out here:

https://rococoa.dev.java.net/objc_msgSend.html

If anyone could spare some time reading this document and putting me
straight, you'd be helping an up-and-coming open-source project. It
might even be tax-deductible.

Thanks in anticipation

Duncan McGregor
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Drawing from secondary thread erases resize corner in window?

2008-02-29 Thread Hank Heijink (Mailinglists)
Sent a message to the list from the wrong account, so it bounced. Here  
it is:


On Feb 28, 2008, at 5:01 PM, Hamish Allan wrote:


You could try kCFRunLoopCommonModes (pre-Leopard) /
NSRunLoopCommonModes (post-Leopard). I believe that
NSDefaultRunLoopMode and NSEventTrackingRunLoopMode are in the default
common modes (along with NSEventTrackingRunLoopMode) but if not, you
can add common modes using CFRunLoopAddCommonMode().


That works beautifully. NSDefaultRunLoopMode and  
NSEventTrackingRunLoopMode are indeed in the default common modes.


Thanks!

Hank
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Better Anti-Aliasing for drawing?

2008-02-29 Thread Ben Lachman

On Feb 29, 2008, at 5:15 AM, Jean-Daniel Dupas wrote:


Le 29 févr. 08 à 10:50, Ben Lachman a écrit :
I have some stuff that I draw rotated a small amount (~10 degrees)  
and the lines looks a little bit chunky for my tastes.  You can  
see an example at: .


Is there any way to coax better antialiasing out of drawing things  
at this small an angle?





Try this:

[[NSGraphicsContext currentContext]  
setImageInterpolation:NSImageInterpolationHigh];




I'm already doing this unfortunately...  Any other thoughts?

Thanks,

->Ben

--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

[EMAIL PROTECTED]
740.590.0009

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scripting Bridge & Mail

2008-02-29 Thread Pavel Kapinos
Peter, 

Apple has just posted an example project of using SB with Mail

http://developer.apple.com/samplecode/SBSendEmail/index.html

It deals with attachments too.

Pavel.


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: setting exif metadata with ApplicationServices framework

2008-02-29 Thread C Sandeep
Hi all,

 I think I have solved this one. I wasn't setting the right type for
the destination properties, hence it wouldn't work. Subsequently I
have posted an small howto on here:
http://sandeepc.livejournal.com/656.html  Hope it helps others.

- Sandeep

On Fri, Feb 22, 2008 at 3:57 PM, C Sandeep <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  Recently I have been playing with adding exif data to image files on disk.
> I found this nice blog entry which shows how. However, Im not able to set
> aperture, ISO and shutter speeds from my code, here (showing literal
> values):
>
>..
> [exifDict setValue: @"800"
> forKey:(NSString *) kCGImagePropertyExifISOSpeedRatings];
>
> [exifDict setValue: @"28/5"
> forKey: (NSString *)
> kCGImagePropertyExifApertureValue];
>
> [exifDict setValue:@"-1507/1140"
> forKey: (NSString *) kCGImagePropertyExifShutterSpeedValue];
>
> NSMutableDictionary *metaData = [NSMutableDictionary dictionary];
> [metaData setObject: exifDict forKey:(NSString
> *)kCGImagePropertyExifDictionary];
>  CGImageDestinationAddImageFromSource(destination,source,0,
> (CFDictionaryRef) metaData);
> CGImageDestinationFinalize(destination);
>.
>
>  However I was able to set the kCGImagePropertyTIFFMake property. Are the
> values for these properties of the wrong format ? How does one set these
> exif meta data ? Thanks.
>
> - Sandeep
>
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Returning values from objc_msgSend etc

2008-02-29 Thread Greg Parker

On Feb 29, 2008, at 11:05 AM, Duncan McGregor wrote:

Are there any Objective-C wizards out there who could review a few
conceptual and practical issues I have returning values from
objc_msgSend and its friends?

I've just released Rococoa, a generic replacement for the Cocoa-Java
bridge, under LGPL. Some things do not work as expected on PPC. I know
I really need to understand how objc_msgSend works, but cannot find a
complete discussion anywhere.


The first thing to do is read and understand the Mac OS X ABI Function  
Call Guide. Objective-C messages follow the C calling conventions.

http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/Introduction.html

Then the rules work like this. Note that the answers may differ for  
each architecture.


* If the return value is stored in one x87 floating-point register,  
use objc_msgSend_fpret. This includes i386 float/double/long double  
and x86_64 long double (but not float/double). On other architectures,  
objc_msgSend_fpret is identical to objc_msgSend.


* If the return value is stored in two x87 floating-point registers,  
use objc_msgSend_fp2ret. I think this is for i386/x86_64 _Complex long  
double only, but might also apply to a struct composed of two long  
double fields.


* If the return value is a struct, and the struct's address is passed  
as the first parameter, use objc_msgSend_stret. Note that some small  
structs on some architectures are returned in registers instead; don't  
use objc_msgSend_stret for them.


* If the return value is a ppc/ppc64 vector, stop. Objective-C  
messages don't support vector parameters.


* For everything else, use objc_msgSend.

When in doubt, write Objective-C code that returns the type you want,  
compile it, and use whichever function the generated assembly code  
chose. This is usually the way to go for structure returns, because  
each architecture has its own arcane rules about which structs are  
returned in registers and which are returned on the stack. ppc64  
struct return in particular is incomprehensible. And the compiler is  
always right; if the compiler and the documentation disagree about  
function calls, the documentation is changed.




* If both objc_msgSend_stret and objc_msgSend hack the stack to return
different sized return values, why are there 2 functions?


For sufficiently-large structures on all architectures, the caller  
passes the address of the storage for the return value as the first  
parameter. This means the other parameters are shifted. That in turn  
means objc_msgSend and objc_msgSend_stret need to look in different  
places to find `self` and `_cmd`.


Also, on i386, the callee pops that struct-return parameter, unlike  
the other parameters which are popped by the caller. So  
objc_msgSend_stret needs to pop the extra value when a message is sent  
to nil, and objc_msgSend doesn't.




* Should I call objc_msgSend_stret when returning longs on PPC?


No. On ppc, longs are 32-bit and returned in a single register. 64-bit  
integers are returned in two registers. Both cases use objc_msgSend.



* Do I really need to call objc_msgSend_fpret for floating point on  
Intel?


Yes. If a message is sent to nil, objc_msgSend_fpret pushes a zero on  
the x87 floating-point stack for the caller to pop. objc_msgSend can't  
do that, because the caller isn't expecting to pop anything.



--
Greg Parker [EMAIL PROTECTED] Runtime Wrangler


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Custom View drawn twice?

2008-02-29 Thread Ben Lachman
Well, I finally was able to get this solved, but not to my  
satisfaction.  What I'm having to do is this:


	if( ! NSContainsRect(rect, [self visibleRect]) && ! NSEqualRects 
(rect,[self visibleRect]) ) {

[self setNeedsDisplayInRect:[self bounds]];
[self displayIfNeededIgnoringOpacity];

return;
}

which in my opinion is a really dirt hack and I'd love to find a  
better (real?) solution.  I'm pretty sure I'm just drawing twice  
between flushing the buffer, but I'm not sure how to debug it or  
prevent it.  Anyone run into something like this?


Thanks,
->Ben
--
Ben Lachman
Acacia Tree Software

http://acaciatreesoftware.com

[EMAIL PROTECTED]
740.590.0009


On Feb 21, 2008, at 1:23 AM, Ben Lachman wrote:

I have a text view that contains a custom view which in turn  
contains an imageview and draws an image and a drop shadow.  During  
selection the bits of the view which are not fully opaque (the  
shadow and the image) sometimes draw twice, producing a darker  
shadow than I want.  This seems to alternate with normal looking  
drawing, so when I select text the shadow flickers between regular  
and darker along with the other non-opaque bits in the image.  My  
method for drawing the shadow looks like this:


- (void)drawRect:(NSRect)rect {
NSAffineTransform *xform = [NSAffineTransform transform];

[NSGraphicsContext saveGraphicsState];

[xform translateXBy:imageViewOrigin.x yBy:imageViewOrigin.y];
[xform rotateByDegrees:rotation];
[xform concat];

NSShadow *imageShadow = [[NSShadow alloc] init];
[imageShadow setShadowOffset:NSMakeSize(0,-5)];
[imageShadow setShadowBlurRadius:5];
[imageShadow setShadowColor:[NSColor blackColor]];

[imageShadow set];
[[NSColor whiteColor] set];
[NSBezierPath fillRect:[imageView bounds]];
[NSGraphicsContext restoreGraphicsState];

[imageShadow release];  
}

I should note that the selection area does not overlap the view  
(custom shaped text container).  Anyone have any ideas as to what  
might be going wrong?

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scripting Bridge & Mail

2008-02-29 Thread Peter Schmidt

Am 29.02.2008 um 20:56 schrieb Pavel Kapinos:


Apple has just posted an example project of using SB with Mail

http://developer.apple.com/samplecode/SBSendEmail/index.html

It deals with attachments too.


Thank you very much! This es _exactly_ what I'm looking for. And I've  
found my Error:


Wrong:
NSDictionary *path = [NSDictionary dictionaryWithObject: @"/Users/ 
schmidt/Desktop/Bild1.png" forKey: @"file name"];


Right:
NSDictionary *path = [NSDictionary dictionaryWithObject: @"/Users/ 
schmidt/Desktop/Bild1.png" forKey: @"fileName"];


Greetings,
Peter
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: complex views in a tableview

2008-02-29 Thread Sean McBride
On 2/28/08 7:15 PM, j o a r said:

>> I haven't used NSCollectionView but I have read about it.  It seems to
>> be geared towards grids more than lists.  I'm looking to have a table
>> with 2 resizable columns: the first a simple string, the second my
>> 'complex view'.  I'm not sure I could really do that with a collection
>> view.  If it were two columns, would it still do selection in terms
>> of rows?
>
>No, it wouldn't. So, I guess it comes down to this: There is no
>control provided by Apple that does exactly what you want, so you
>would either have to build something from scratch yourself, or attempt
>to modify / tweak / hack one of the existing controls. You can hack

That's what I figured, but wanted to check here first...

>the NSTableView to sort of work that way, like I showed with my
>SubViewTableView example, or you might be able to hack the
>NSCollectionView to sort of work that way.

I guess your example is still the best starting point then.

Thanks!

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: CATextLayer metrics

2008-02-29 Thread Karl Goiser

Thanks Scott and Bill!

On 01/03/2008, at 3:42 AM, Scott Anguish wrote:

CATextLayer is largely a convenience class.  It provides text  
features, but very little flexibility.


You can easily subclass CALayer and create your own text layer that  
uses NSFont, complex text layout , and all the familiar methods.   
Plus you'll get more flexibility.


I guess that was the answer all along..


The irksome thing is that rolling your own text layer means  
duplicating pretty-well all of CATextLayer (maybe that's not much!) -  
all for the want of some details of how the text is rendered...  If  
details were published, it would be pretty easy to subclass and reuse  
- which is, of course, one of the main features and objectives of  
object-oriented programming.



But Scott is probably right in that I might want more flexibility than  
could be provided by any subclassing of CATextLayer.



Thanks again guys!


Karl

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Apple Help question

2008-02-29 Thread Matt Neuburg
On Wed, 27 Feb 2008 12:12:57 -0500 (EST), "z" <[EMAIL PROTECTED]> said:
>
>I have problems trying to implement Apple Help.
>All I get is an empty help window without a title.
>
>My index.html file is:
> 
>My Info.plist includes:
> CFBundleHelpBookName
> Yellow Help Book

Blp! Mismatch, did not follow directions, game over, thank you for
playing! :) m.

-- 
matt neuburg, phd = [EMAIL PROTECTED], 
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: 
AppleScript: the Definitive Guide - Second Edition!




___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: CATextLayer metrics

2008-02-29 Thread Scott Anguish


On Feb 29, 2008, at 2:00 PM, Karl Goiser wrote:
The irksome thing is that rolling your own text layer means  
duplicating pretty-well all of CATextLayer (maybe that's not much!)  
- all for the want of some details of how the text is rendered...   
If details were published, it would be pretty easy to subclass and  
reuse - which is, of course, one of the main features and objectives  
of object-oriented programming.



	It really isn't anything significant.  You can file a bug asking for  
more rendering details though..


You have very little to subclass and override mind you.

There was no interest in rebuilding any significant text layout there..


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


How to make a bevel button with pop-up menu?

2008-02-29 Thread Sean McBride
Hi all,

I'm trying to make a bevel button with pop-up menu (see HIG figure
15-28: ).

The instructions do not seem to work.  I just can't seem to get the
downward pointing arrow to be in the bottom right corner.  Instead it is
on the right edge, but centred vertically.

Anyone got this to work?

Thanks,

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Custom View drawn twice?

2008-02-29 Thread Ken Ferry
I don't see a problem in your drawRect: code, so it'd be in something
you haven't posted.  Perhaps you could post a sample application?

One possibility is that your -isOpaque method returns YES, so the view
system thinks it doesn't have to redraw your superview before asking
you to draw.

If you're subclassing NSView, you'd have to opt-in to return YES from
-isOpaque, but if you're subclassing a deeper AppKit view class, it
may already be marked as opaque.

-Ken

On Fri, Feb 29, 2008 at 11:55 AM, Ben Lachman <[EMAIL PROTECTED]> wrote:
> Well, I finally was able to get this solved, but not to my
>  satisfaction.  What I'm having to do is this:
>
> if( ! NSContainsRect(rect, [self visibleRect]) && ! NSEqualRects
>  (rect,[self visibleRect]) ) {
> [self setNeedsDisplayInRect:[self bounds]];
> [self displayIfNeededIgnoringOpacity];
>
> return;
> }
>
>  which in my opinion is a really dirt hack and I'd love to find a
>  better (real?) solution.  I'm pretty sure I'm just drawing twice
>  between flushing the buffer, but I'm not sure how to debug it or
>  prevent it.  Anyone run into something like this?
>
>  Thanks,
>
> ->Ben
>  --
>  Ben Lachman
>  Acacia Tree Software
>
>  http://acaciatreesoftware.com
>
>  [EMAIL PROTECTED]
>  740.590.0009
>
>
>
>
> On Feb 21, 2008, at 1:23 AM, Ben Lachman wrote:
>
>  > I have a text view that contains a custom view which in turn
>  > contains an imageview and draws an image and a drop shadow.  During
>  > selection the bits of the view which are not fully opaque (the
>  > shadow and the image) sometimes draw twice, producing a darker
>  > shadow than I want.  This seems to alternate with normal looking
>  > drawing, so when I select text the shadow flickers between regular
>  > and darker along with the other non-opaque bits in the image.  My
>  > method for drawing the shadow looks like this:
>  >
>  > - (void)drawRect:(NSRect)rect {
>  >   NSAffineTransform *xform = [NSAffineTransform transform];
>  >
>  >   [NSGraphicsContext saveGraphicsState];
>  >
>  >   [xform translateXBy:imageViewOrigin.x yBy:imageViewOrigin.y];
>  >   [xform rotateByDegrees:rotation];
>  >   [xform concat];
>  >
>  >   NSShadow *imageShadow = [[NSShadow alloc] init];
>  >   [imageShadow setShadowOffset:NSMakeSize(0,-5)];
>  >   [imageShadow setShadowBlurRadius:5];
>  >   [imageShadow setShadowColor:[NSColor blackColor]];
>  >
>  >   [imageShadow set];
>  >   [[NSColor whiteColor] set];
>  >   [NSBezierPath fillRect:[imageView bounds]];
>  >   [NSGraphicsContext restoreGraphicsState];
>  >
>  >   [imageShadow release];
>  > }
>  >
>  > I should note that the selection area does not overlap the view
>  > (custom shaped text container).  Anyone have any ideas as to what
>  > might be going wrong?
>
>
> ___
>
>  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)lists.apple.com
>
>  Help/Unsubscribe/Update your Subscription:
>  http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com
>
>  This email sent to [EMAIL PROTECTED]
>
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Steve Weller


I have a custom view into which I can draw a background color and a  
centered rectangle. As the window is resized, the rectangle stays  
centered and is clipped when the window gets small.


I want to define a canvas size slightly bigger than the rectangle and  
have the scrollers appear when the available space is less than the  
canvas needs. I override setFrameSize to do this:


- (void) setFrameSize:(NSSize)newSize
{
NSSize cSize;
cSize = [self canvasSize];   // Provides a size

// Use the larger dimensions of the two rects
if(newSize.width > cSize.width)
cSize.width = newSize.width;
if(newSize.height > cSize.height)
cSize.height = newSize.height;

 [super setFrameSize:cSize];
}

And this works as long as the window is only made smaller. If the  
window is made larger then the scrollers do not disappear.


Is my approach the right one for what I am trying to achieve?

If it is, how can I fix the scroller problem?

--
Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.com/




___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


View mouse Events

2008-02-29 Thread cai qin
Hi all ,

I have a question about how view handling events . I have a view in the
middle of the window .

|=myWindow===|
||
| |--||
| |  ||
| | myView  |   |
| |  ||
| |--||
||
||

I hold mouse button down inside my window ,but outside myView.
I drag the mouse to myView . Can myView receive some events message?
If it can't , how can I send something to myView and tell it ,"Hey , the
mouse are coming!"??
___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: View mouse Events

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 16:04, cai qin wrote:


I hold mouse button down inside my window ,but outside myView.
I drag the mouse to myView . Can myView receive some events message?
If it can't , how can I send something to myView and tell it ,"Hey ,  
the

mouse are coming!"??


Set up a NSTrackingArea on your view, with the option for entered/exit  
tracking, *and* the option for entered/exit tracking while dragging.  
You'll then get mouseEntered and mouseExited events in your view.


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 16:00, Steve Weller wrote:


- (void) setFrameSize:(NSSize)newSize
{
NSSize cSize;
cSize = [self canvasSize];   // Provides a size

// Use the larger dimensions of the two rects
if(newSize.width > cSize.width)
cSize.width = newSize.width;
if(newSize.height > cSize.height)
cSize.height = newSize.height;

 [super setFrameSize:cSize];
}

And this works as long as the window is only made smaller. If the  
window is made larger then the scrollers do not disappear.


Is my approach the right one for what I am trying to achieve?


Probably not. There are various ways the view frame can change, and  
they don't all funnel through the setFrameSize method.


If you register to receive NSViewFrameDidChangeNotification's for your  
view (remembering to call setPostsFrameChangedNotifications: YES), it  
might work to do something like this in the notification method:


[[NSNotificationCenter defaultCenter] removeObserver: self];
NSRect frame = [self frame];
// calculate new frame
[self setFrame: frame];
[[NSNotificationCenter defaultCenter] addObserver: self ...

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Steve Weller


On Feb 29, 2008, at 4:46 PM, Quincey Morris wrote:



On Feb 29, 2008, at 16:00, Steve Weller wrote:


- (void) setFrameSize:(NSSize)newSize
{
NSSize cSize;
cSize = [self canvasSize];   // Provides a size

// Use the larger dimensions of the two rects
if(newSize.width > cSize.width)
cSize.width = newSize.width;
if(newSize.height > cSize.height)
cSize.height = newSize.height;

 [super setFrameSize:cSize];
}

And this works as long as the window is only made smaller. If the  
window is made larger then the scrollers do not disappear.


Is my approach the right one for what I am trying to achieve?


Probably not. There are various ways the view frame can change, and  
they don't all funnel through the setFrameSize method.


If you register to receive NSViewFrameDidChangeNotification's for  
your view (remembering to call setPostsFrameChangedNotifications:  
YES), it might work to do something like this in the notification  
method:


[[NSNotificationCenter defaultCenter] removeObserver: self];
NSRect frame = [self frame];
// calculate new frame
[self setFrame: frame];
[[NSNotificationCenter defaultCenter] addObserver: self ...




I implemented this with no change no behavior.

The higher level problem I am trying to solve is this:

My custom view spans the window's content view. I want to draw a white  
rectangle (think of a document) centered in that area and fill the  
remainder gray. In my drawRect method I first draw gray into the  
rectangle passed. Then I calculate where the white rectangle should be  
and draw it.


I need the scrollers to act on the bounds of the white rectangle so  
that they are present when any part of it is not visible.


Should I be putting my custom view inside another view and doing the  
centering and background color with IB instead?


What is the best way of implementing this?


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 18:10, Steve Weller wrote:

My custom view spans the window's content view. I want to draw a  
white rectangle (think of a document) centered in that area and fill  
the remainder gray. In my drawRect method I first draw gray into the  
rectangle passed. Then I calculate where the white rectangle should  
be and draw it.


I need the scrollers to act on the bounds of the white rectangle so  
that they are present when any part of it is not visible.


The question is, where are your scroll bars coming from? Did you put  
your custom view inside a scroll view, or did you add scroll bars  
manually?


When the scroll bars fail to disappear, if you manually drag the  
thumb, what happens? It's possible you'll have to adjust the frame  
origin as well as the width.

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 18:46, Steve Weller wrote:


There is always too much frame once the scroll bars appear.


That's something only you can debug. If you break on the frame change  
notification, you should be able to watch the wrong frame being  
calculated.


___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Steve Weller


On Feb 29, 2008, at 4:00 PM, Steve Weller wrote:



I have a custom view into which I can draw a background color and a  
centered rectangle. As the window is resized, the rectangle stays  
centered and is clipped when the window gets small.


I want to define a canvas size slightly bigger than the rectangle  
and have the scrollers appear when the available space is less than  
the canvas needs. I override setFrameSize to do this:


- (void) setFrameSize:(NSSize)newSize
{
NSSize cSize;
cSize = [self canvasSize];   // Provides a size

// Use the larger dimensions of the two rects
if(newSize.width > cSize.width)
cSize.width = newSize.width;
if(newSize.height > cSize.height)
cSize.height = newSize.height;

 [super setFrameSize:cSize];
}

And this works as long as the window is only made smaller. If the  
window is made larger then the scrollers do not disappear.


Is my approach the right one for what I am trying to achieve?

If it is, how can I fix the scroller problem?


I figured it out. Key to my confusion was that I was not involving the  
superview in the calculation.

In my -awakeFromNib I put this code:

// Receive notifications if the frame changes
[self setPostsBoundsChangedNotifications: YES];

NSNotificationCenter *center = [NSNotificationCenter defaultCenter] ;
[center addObserver: self
   selector: @selector(frameDidChangeNotification:)
   name: NSViewFrameDidChangeNotification
 object: self];

NSSize cSize;
cSize = [self canvasSize];
[self setFrame:NSMakeRect(0,0,cSize.width,cSize.height)];

and I added

// The frame has changed
-(void)frameDidChangeNotification:(NSNotification *)notification
{

[[NSNotificationCenter defaultCenter] removeObserver: self];
NSRect frame = [[self superview] frame];
NSSize cSize;
cSize = [self canvasSize];

// Use the larger dimensions of the canvas and the superview
if(frame.size.width > cSize.width)
cSize.width = frame.size.width; 
if(frame.size.height > cSize.height)
cSize.height = frame.size.height;

	[self  
setFrame:NSMakeRect 
(frame.origin.x,frame.origin.y,cSize.width,cSize.height)];

//  NSLog(@"%f %f",newSize.width, newSize.height);

NSNotificationCenter *center = [NSNotificationCenter defaultCenter] ;
[center addObserver: self
   selector: @selector(frameDidChangeNotification:)
   name: NSViewFrameDidChangeNotification
 object: self];

}

This figures out the rectangle that encloses both the canvas and the  
superview's frame and makes my custom view's frame equal to that. The  
only remaining thing to fix is that the lower left point is always  
shown in the view, when I actually want the center point to be shown.  
So I have to shift the frame origin as part of the calculation.




___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Scrollers on custom view appearing but not disappearing

2008-02-29 Thread Quincey Morris


On Feb 29, 2008, at 21:31, Steve Weller wrote:


-(void)frameDidChangeNotification:(NSNotification *)notification
{

[[NSNotificationCenter defaultCenter] removeObserver: self];
NSRect frame = [[self superview] frame];
NSSize cSize;
cSize = [self canvasSize];

// Use the larger dimensions of the canvas and the superview
if(frame.size.width > cSize.width)
cSize.width = frame.size.width; 
if(frame.size.height > cSize.height)
cSize.height = frame.size.height;

	[self  
setFrame:NSMakeRect 
(frame.origin.x,frame.origin.y,cSize.width,cSize.height)];

//  NSLog(@"%f %f",newSize.width, newSize.height);

NSNotificationCenter *center = [NSNotificationCenter defaultCenter] ;
   [center addObserver: self
   selector: @selector(frameDidChangeNotification:)
   name: NSViewFrameDidChangeNotification
 object: self];

}

This figures out the rectangle that encloses both the canvas and the  
superview's frame and makes my custom view's frame equal to that.  
The only remaining thing to fix is that the lower left point is  
always shown in the view, when I actually want the center point to  
be shown. So I have to shift the frame origin as part of the  
calculation.


A couple of small points:

-- It's not quite correct to use the superview's frame to calculate a  
view's frame, since they are in different coordinate systems. You  
really should use [[self superview] bounds], which is in the same  
coordinate system as [self frame].


The problem is harmless in this case, because the superview is a  
NSClipView, which happens to keep its frame coordinate system  
synchronized with that of view it contains, but this is not generally  
true of view-superview geometry.


-- If you want to refer to the clip view, [[self enclosingScrollView]  
contentView] is more correct than [self superview]. The fact that  
they're the same thing is an implementation detail. (But if you're  
going to pretend not to know they're the same you really should do an  
explicit coordinate conversion when combining their dimensions.)


-- As someone suggested on this list a few weeks ago, it's perhaps  
marginally more elegant to use [self visibleRect] instead of the clip  
view bounds. Although the purpose of the clip view is to manage the  
visible rect of the view it contains, using the visible rect directly  
means you don't have to build in knowledge of that implementation  
detail. And there's no coordinate conversion needed.



___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Charting API?

2008-02-29 Thread Robert Douglas
When I looked into this last fall I decided I liked the look of  
DataGraph and bought a license, but then I ran into  trouble   
incorporating it into a garbage-collected app and started writing my  
own.  Mind you, that could have been me and my Fortran IV - imprinted  
brain, but now I too am reevaluating the situation.   GC is no longer  
relevant as I'm using core video buffers, but now I'm worried about  
the long-term viability of all the libraries mentioned (DataGraph,  
SM2DGraphView, Vvidget,  Google Chart, Narrative etc.).   I'm inclined  
to go with SM2DGraphView as the source code is available and  
understandable.

-Rob

On 29-Feb-08, at 6:34 AM, Jiva DeVoe wrote:

I'll add my recommendation for SM2DGraphView as well. The docs are  
good and the code works well.


--
Jiva DeVoe
http://www.random-ideas.net

On Feb 27, 2008, at 4:56 PM, "Kyle Sluder" <[EMAIL PROTECTED] 
> wrote:


On Wed, Feb 27, 2008 at 2:14 PM, Chris Schmitt <[EMAIL PROTECTED]>  
wrote:
I want to add some simple bar graphs and pie charts to my  
project.  Is

there an apple api for charting or do you need to use a 3rd party
product?


Apple's framework is private.  I've been toying with SM2DGraphView,
it's pretty nice:
http://developer.snowmintcs.com/frameworks/sm2dgraphview/

--Kyle Sluder
___

___

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)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]