Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 18, 2017 3:44 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Scrollbar visible settings in Mountain Lion
PostPosted: Tue Apr 16, 2013 5:26 pm 
Offline

Joined: Thu Jan 12, 2006 3:26 am
Posts: 171
In System Preferences -> General there is an option for "Show scroll bars"

Is it possible to get the selected option here or if scrollbars should be shown based on the user's settings?

Thanks,

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar visible settings in Mountain Lion
PostPosted: Thu May 02, 2013 10:02 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
paul85 wrote:
In System Preferences -> General there is an option for "Show scroll bars"

Is it possible to get the selected option here or if scrollbars should be shown based on the user's settings?

Thanks,

It should be possible to access this using defaults terminal command or a declare, my question however is what do you want to do with that information?

If you are using Cocoa, the scrollbars automatically obey this setting, from my understanding there is a feedback request for the listbox to follow this behavior too. If you are creating your own custom view, there is a feedback request for a ScrollView, which again will automagically obey this setting.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar visible settings in Mountain Lion
PostPosted: Thu May 02, 2013 10:59 pm 
Offline

Joined: Thu Jan 12, 2006 3:26 am
Posts: 171
Thanks Sam.

I'm using a custom canvas that needs scrollbars to scroll it's contents.

Do you happen to know the declares or terminal commands?

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar visible settings in Mountain Lion
PostPosted: Fri May 03, 2013 1:52 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
paul85 wrote:
Thanks Sam.

I'm using a custom canvas that needs scrollbars to scroll it's contents.

Do you happen to know the declares or terminal commands?

Hi Paul,

So I looked it up, it requires 10.7+ while I've wrapped this code in a Try statement, please use another way to check also.

Try
declare function NSClassFromString lib "Cocoa" (aClassName as CFStringRef) as Ptr
// This requires 10.7 or higher
// + (NSScrollerStyle)preferredScrollerStyle
soft declare function preferredScrollerStyle lib "Cocoa" selector "preferredScrollerStyle" ( classRef as Ptr ) as integer
Dim scrollerStyle as integer = preferredScrollerStyle( NSClassFromString( "NSScroller" ) )

const NSScrollerStyleLegacy = 0
const NSScrollerStyleOverlay = 1

select case scrollerStyle
case NSScrollerStyleLegacy
MsgBox "Use the old scroll bars"

case NSScrollerStyleOverlay
MsgBox "Use the 10.7 ""Overlay"" scroll bars."

end select

end try


Basically I ask the NSScroller class which is the 'Preferred Style' and then compare against the constants. I would also recommend signing on to the feature request for a proper Scroll View as this will make your life a lot easier in the future.

[url]<feedback://showreport?report_id=16134>[/url]

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar visible settings in Mountain Lion
PostPosted: Sat May 04, 2013 6:20 pm 
Offline

Joined: Thu Jan 12, 2006 3:26 am
Posts: 171
Hi Sam,

Thanks a lot for the code.

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Scrollbar visible settings in Mountain Lion
PostPosted: Sat May 04, 2013 9:19 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
paul85 wrote:
Hi Sam,

Thanks a lot for the code.

You're welcome.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group