Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Re: Cocoa Declares (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Cocoa - Subclassed Menuitem Action Events Don't Fire(?)
Next thread: [ANN] iBasic


Re: [OT- Soft of] Thread Hijacking   -   Rubber Chicken Software Co.
  Re: Cocoa Declares   -   emile.a.schwarz
   Re: Cocoa Declares   -   Charles Yeomans
   Re: Cocoa Declares   -   Charles Yeomans
   Re: Cocoa Declares   -   Stéphane Mons <
   Re: Cocoa Declares   -   Sam Rowlands
    Cocoa Declares   -   Sam Rowlands
     Re: Cocoa Declares   -   Charles Yeomans
     Re: Cocoa Declares   -   Eric Williams

Re: Cocoa Declares
Date: 29.09.11 17:28 (Thu, 29 Sep 2011 18:28:13 +0200 (CEST))
From: emile.a.schwarz
Hi,

Le 29/09/11 04:33, <email address removed> a écrit :
> Date: Wed, 28 Sep 2011 19:29:51 -0700
> From: Eric Williams
> Subject: Re: Cocoa Declares
> To: Realbasic NUG
> Message-ID:<<email address removed>>
> Content-Type: text/plain; charset=us-ascii
>
> On Sep 28, 2011, at 7:10 PM, Sam Rowlands wrote:
>
>> > Hi Guys,
>> > I need a kick start to getting a simple Cocoa declare to work. So far everything I tried results in the RS IDE generating an error and my app never starting.
>> >
>>> >> From Objective-C
>> > [NSColorSpace genericRGBColorSpace]
>> > > So far I've got a couple of things working fine in RS, but I can't get this little bugger to work.
>> > > the last RS code I've tried is the following.
>> > > Dim rbco as new RBCocoaObject("file://System/Library/Frameworks/AppKit.framework", "NSColorSpace", "genericRGBColorSpace" )
>> > > Any help would be appreciated.
> Use MacOSLib:
>
> http://code.google.com/p/macoslib/
>
> It will do a LOT of what you probably need to have done, and you can learn how to do the Cocoa declares from the code.
>
> Eric M. Williams
> Oxalyn
Then learn svn…

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Cocoa Declares
Date: 29.09.11 17:46 (Thu, 29 Sep 2011 12:46:21 -0400)
From: Charles Yeomans

On Sep 29, 2011, at 12:28 PM, emile.a.schwarz wrote:

> Hi,
>
> Le 29/09/11 04:33, <email address removed> a écrit :
>> Date: Wed, 28 Sep 2011 19:29:51 -0700
>> From: Eric Williams
>> Subject: Re: Cocoa Declares
>> To: Realbasic NUG
>> Message-ID:<<email address removed>>
>> Content-Type: text/plain; charset=us-ascii
>>
>>
>> On Sep 28, 2011, at 7:10 PM, Sam Rowlands wrote:
>>
>>>> Hi Guys,
>>>> I need a kick start to getting a simple Cocoa declare to work. So far everything I tried results in the RS IDE generating an error and my app never starting.
>>>>
>>>>>> From Objective-C
>>>> [NSColorSpace genericRGBColorSpace]
>>>>> So far I've got a couple of things working fine in RS, but I can't get this little bugger to work.
>>>>> the last RS code I've tried is the following.
>>>>> Dim rbco as new RBCocoaObject("file://System/Library/Frameworks/AppKit.framework", "NSColorSpace", "genericRGBColorSpace" )
>>>>> Any help would be appreciated.
>> Use MacOSLib:
>>
>> http://code.google.com/p/macoslib/
>>
>> It will do a LOT of what you probably need to have done, and you can learn how to do the Cocoa declares from the code.
>>
>> Eric M. Williams
>> Oxalyn
> Then learn svn…

macoslib now uses git.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Cocoa Declares
Date: 29.09.11 13:14 (Thu, 29 Sep 2011 08:14:05 -0400)
From: Charles Yeomans

On Sep 29, 2011, at 1:47 AM, Sam Rowlands wrote:

> Hi Eric,
> Thanks for the pointer, I took a look and realized why my declares don't work. There is no built-in function to get a class ref before calling upon it. If you're doing flat declares! Too bad. It requires either a developer to download the MacOSLib or learn about the more complicated depths of Apple Cocoa toolbox before they can write flat declares.
>
> As for the RBCocoaObject, I'd like to see some more documentation on using it as I've only been able to use it to modify a window.
>
> Sadly the MacOSLib doesn't contain NSColor classes, which is what I was trying to work on this morning, but hopefully I'll get somewhere trying a different method to create declares than the RBCocoaObject.

You must have an old version of macoslib, because I added an NSColor class some time ago.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Cocoa Declares
Date: 29.09.11 10:57 (Thu, 29 Sep 2011 11:57:54 +0200)
From: Stéphane Mons <

Le 29 sept. 2011 à 07:47, Sam Rowlands a écrit :

> Hi Eric,
> Thanks for the pointer, I took a look and realized why my declares don't work. There is no built-in function to get a class ref before calling upon it. If you're doing flat declares! Too bad. It requires either a developer to download the MacOSLib or learn about the more complicated depths of Apple Cocoa toolbox before they can write flat declares.
>
> As for the RBCocoaObject, I'd like to see some more documentation on using it as I've only been able to use it to modify a window.
>
> Sadly the MacOSLib doesn't contain NSColor classes, which is what I was trying to work on this morning, but hopefully I'll get somewhere trying a different method to create declares than the RBCocoaObject.

RBCocoaObjects are evil ! Use declares.

The only update that should be done in the documentation about RBCocoaObject is to delete the corresponding pages.


5 REM My Signature
10 PRINT "Stéphane"
20 GOTO 10



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Cocoa Declares
Date: 29.09.11 06:47 (Thu, 29 Sep 2011 13:47:20 +0800)
From: Sam Rowlands
Hi Eric,
Thanks for the pointer, I took a look and realized why my declares don't work. There is no built-in function to get a class ref before calling upon it. If you're doing flat declares! Too bad. It requires either a developer to download the MacOSLib or learn about the more complicated depths of Apple Cocoa toolbox before they can write flat declares.

As for the RBCocoaObject, I'd like to see some more documentation on using it as I've only been able to use it to modify a window.

Sadly the MacOSLib doesn't contain NSColor classes, which is what I was trying to work on this morning, but hopefully I'll get somewhere trying a different method to create declares than the RBCocoaObject.

Have a Great Week :)

Sam Rowlands



On Sep 29, 2011, at 10:33 AM, <email address removed> wrote:

> It will do a LOT of what you probably need to have done, and you can learn how to do the Cocoa declares from the code.
>
> Eric M. Williams
> Oxalyn

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Cocoa Declares
Date: 29.09.11 03:10 (Thu, 29 Sep 2011 10:10:01 +0800)
From: Sam Rowlands
Hi Guys,
I need a kick start to getting a simple Cocoa declare to work. So far everything I tried results in the RS IDE generating an error and my app never starting.

>From Objective-C
[NSColorSpace genericRGBColorSpace]

So far I've got a couple of things working fine in RS, but I can't get this little bugger to work.

the last RS code I've tried is the following.

Dim rbco as new RBCocoaObject( "file://System/Library/Frameworks/AppKit.framework", "NSColorSpace", "genericRGBColorSpace" )

Any help would be appreciated.

Have a Great Week :)

Sam Rowlands



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Cocoa Declares
Date: 29.09.11 03:42 (Wed, 28 Sep 2011 22:42:53 -0400)
From: Charles Yeomans

On Sep 28, 2011, at 10:10 PM, Sam Rowlands wrote:

> Hi Guys,
> I need a kick start to getting a simple Cocoa declare to work. So far everything I tried results in the RS IDE generating an error and my app never starting.
>
>> From Objective-C
> [NSColorSpace genericRGBColorSpace]
>
> So far I've got a couple of things working fine in RS, but I can't get this little bugger to work.
>

The following code should work. It's useful when posting such a request for you to explain how it doesn't work; e.g. compiler complains, function doesn't return what you expected, app crashes, etc.

const Cocoa = "Cocoa.framework"
declare function NSClassFromString lib Cocoa (name as CFStringRef) as Ptr
declare function genericRGBColorSpace lib Cocoa selector "genericRGBColorSpace" (class_id as Ptr) as Ptr

dim p as Ptr = genericRGBColorSpace(NSClassFromString("NSColorSpace"))

And there is an NSColorspace class in macoslib.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Cocoa Declares
Date: 29.09.11 03:29 (Wed, 28 Sep 2011 19:29:51 -0700)
From: Eric Williams

On Sep 28, 2011, at 7:10 PM, Sam Rowlands wrote:

> Hi Guys,
> I need a kick start to getting a simple Cocoa declare to work. So far everything I tried results in the RS IDE generating an error and my app never starting.
>
>> From Objective-C
> [NSColorSpace genericRGBColorSpace]
>
> So far I've got a couple of things working fine in RS, but I can't get this little bugger to work.
>
> the last RS code I've tried is the following.
>
> Dim rbco as new RBCocoaObject( "file://System/Library/Frameworks/AppKit.framework", "NSColorSpace", "genericRGBColorSpace" )
>
> Any help would be appreciated.

Use MacOSLib:

http://code.google.com/p/macoslib/

It will do a LOT of what you probably need to have done, and you can learn how to do the Cocoa declares from the code.

Eric M. Williams
Oxalyn

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>