Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Aug 05, 2020 2:54 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: RBCocoaObjects to declares
PostPosted: Sun Oct 30, 2011 1:16 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
Seeing as I do not have any experience with the old/new/preferred way of doing declares, could someone with some experience with them show me how this one should be done using them? [hopefully be easy enough]

Dim tCocoaObject As New RBCocoaObject( Ptr( pWindow.handle ) )
tCocoaObject.Invoke("setBottomCornerRounded:", pValue )

_________________
Real Studio 2012r1.1 | MacBook Pro i5, 10.6.8 | Windows 7


Top
 Profile  
Reply with quote  
 Post subject: Re: RBCocoaObjects to declares
PostPosted: Sun Oct 30, 2011 9:55 am 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
That's an undocumented Cocoa method, so you can't do what you'd normally do and check the Cocoa API, but I assume it will look like this:
#if TargetCocoa
Soft Declare Sub setBottomCornerRounded Lib "AppKit" Selector "SetBottomCornerRounded:" (inWindow As WindowPtr, IsSet As Boolean)
setBottomCornerRounded(pWindow.handle, pValue)
#endif

Mind you that's untested, but it will look something very close to that if that doesn't work. Notice I use "Soft" at the beginning of the declare, which you may want to read up on. It's really not necessary in this instance, but I tend to do it out of habit — I don't want lib problems unless I actually go to use the lib method.

Hope this helps. :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: RBCocoaObjects to declares
PostPosted: Mon Oct 31, 2011 12:07 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
thanks.. i will give that a try and see how it works.. :-)


Top
 Profile  
Reply with quote  
 Post subject: Re: RBCocoaObjects to declares
PostPosted: Mon Oct 31, 2011 1:52 am 
Offline

Joined: Mon Aug 15, 2011 10:25 pm
Posts: 293
Just had to make a few modifications and it is working..

soft declare sub setBottomCornerRounded lib "Cocoa" selector "setBottomCornerRounded:" (inWindow As Integer, IsSet As Boolean)
setBottomCornerRounded pWindow.Handle, pValue


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group