List of Declares?

Hi,
Does anyone know if there is a list of OS X declares available anywhere, which can be pasted into Xojo apps?
I’m not looking for anything particular - just thought maybe there might be something out there which would be useful.

Thanks.

This should be in the OSX channel, since it is about OSX…

Have you looked at MacOSLib ?

Not quite a list of declares, but here’s the source of all (Cocoa) declares…

https://developer.apple.com/library/mac/navigation/

+1 for MacOSLib

There is a webinar on Tuesday being given by Kem on how to get the most out of MacOSLib Link

Patrick, I’m registered for Kem’s webinar - looking forward to that :slight_smile:

Sam, thanks for the link.
I cannot seem to find any actual declares anywhere, so I think I will have to start collecting them as I go along, and then make them available to anyone who wants them.

Thanks guys.

[quote=108337:@Richard Summers]Patrick, I’m registered for Kem’s webinar - looking forward to that :slight_smile:

Sam, thanks for the link.
I cannot seem to find any actual declares anywhere, so I think I will have to start collecting them as I go along, and then make them available to anyone who wants them.

Thanks guys.[/quote]
Look at MacOSLib first. If you find things that are not in there, add them (or ask that they be added).

My biggest problem with MacOSLIB is there is a ton of stuff there, and next to ZERO documentation (ie. comments).
You can find a method or function that uses a declare, with no clue what it does, what context to use it it, if it might have side-effects that need to be dealt with etc. And yes, many many of these are NOT part of any example, and even so without more information I find it difficult to determine if they can be used to solve any particular problem/issue.

[quote=108349:@Dave S]My biggest problem with MacOSLIB is there is a ton of stuff there, and next to ZERO documentation (ie. comments).
You can find a method or function that uses a declare, with no clue what it does, what context to use it it, if it might have side-effects that need to be dealt with etc. And yes, many many of these are NOT part of any example, and even so without more information I find it difficult to determine if they can be used to solve any particular problem/issue.[/quote]
There are a ton of examples though. For everything else, you simply browse the classes, check the methods that have been exposed and then consult Apple’s documentation.

I didn’t say there were not tons of examples… I just indicated that with the amount of work that went into it…standard programming protocol calls for explantory comments whenever the action of the code is not directly obvious… and especially in the case of a project like MacOSLib.

And if you think about…someone with the correct experience to decypher Apples Docs (which I find quite cryptic) would most like not even need MacOSLib, as they would be the people most able to know what API etc were available, and how to use them.

So because of this I rarely ever use MacOSLib, but attempt to do it the HARD way, and end up learning much more in the process.

Yes, Apple’s docs are quite dense if you’re not used to them.

But I’m just trying to encourage people to dig in and check it out, using MacOSLib as your guide, I don’t think it’s as difficult as people think.

For example, if I’m browsing MacOSLib in the Navigator, and I go into the Cocoa module, then browse the Classes and pick, say, NSSearchField. Next, just Googling the class name (NSSearchField) will normally bring you straight to the documentation for that class on Apple’s site, as the first hit. Compare the list of Instance Methods on Apple’s site with the list of Methods for that class in the Navigator. recentSearches is described as “Returns the list of recent search strings for the control” - seems easy enough, no?

We could go on and on about this… but I choose not to

You said “You can find a method or function that uses a declare, with no clue what it does” and I told you how to precisely find out what the method does. You want the MacOSLib contributors to copy and paste the documentation for you?

there is a category ‘Declares’ on Xippets

Xippets Declares

Sure if this were a being developed as a product. But it’s not.
As far as I know it started largely with Charles Yeomans collecting adding to & improving what used to be the Carbon Declare Library.
Then he added Cocoa declares to it as he needed it.
Now it’s a very small group of contributors who’ve used their free time to create it, improve it & maintain it.
Docs are, as Gavin suggested, easy to come by so I’m not sure that their time is best spent reproducing Apples docs - esp since they’d probably be violating copyrights if they did so.

[quote=108355:@Dave S]I didn’t say there were not tons of examples… I just indicated that with the amount of work that went into it…standard programming protocol calls for explantory comments whenever the action of the code is not directly obvious… and especially in the case of a project like MacOSLib.

And if you think about…someone with the correct experience to decypher Apples Docs (which I find quite cryptic) would most like not even need MacOSLib, as they would be the people most able to know what API etc were available, and how to use them.

So because of this I rarely ever use MacOSLib, but attempt to do it the HARD way, and end up learning much more in the process.[/quote]

I tend to use both the esoteric Apple developer documentation and the not documented MacOSLib :wink:

The way I go is after reading Apple literature, I search in the MacOSLib project for the function name. When found, I try to make heads and tails from the MacOSLib particular module methods.

That said, and even if his documentation is not perfect, I find Christian plugins much better explained. Well. Almost much better, with the exception of DynaPDF, which should have been written by the same guys who write #AppleObfuscatedStuff.

From what I’ve seen, at least some of Christian’s documentation is taken directly from Apple’s website. For example, NSViewMBS.wantsRestingTouches and Apple’s NSView documentation.

Yes, I think most of his docs are an exact copy of Apple’s. Amusingly, any time I’ve done Xcode/Objective-C work, when I search for a Cocoa class, I always see the MBS docs as one of the first links :slight_smile:

Speaking of MacOSLib, I hope Kem shows us how to use the NSStatusItem with a NSPopover window with other controls on it…wink…wink :stuck_out_tongue:

+1 for that post Kuzey!

What exactly are you thinking of? This is not too difficult and I have several projects that use it. I can put together an example in the next few days if you describe what you are thinking of.