Get Mac OS Dock size

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Get Mac OS Dock size

Post by jalz » Wed Sep 17, 2014 9:38 pm

Hey all,

Long shot, but is it possible to find out how big (tall) the Mac Dock is if its positioned at the bottom of the screen. I'm trying to script a stack size that opens open the screen depth, but on Macs the Dock gets in the way to window resize handle on the stack.

Thanks all
Jalz

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Get Mac OS Dock size

Post by Simon » Wed Sep 17, 2014 10:55 pm

Hi Jalz,
You use "the working screenRect", check it out in the dictionary.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Get Mac OS Dock size

Post by jalz » Wed Sep 17, 2014 11:35 pm

Hi Simon,

Yes, I'm using the the screendepth and then item 4 to determine how much horizontal screen space I have.

Code: Select all

 
put the screenrect into tScreenSize
put item 4 of tScreenSize into tScreenDepth
When I open my stack, I check the screenDepth and appropriately resize the height of the stack. This works fine in Windows. My problem is when I switch over to the Mac, I have a mac that has a dock with icons that approx 70px height, so my stack opens up behind the doc which makes it difficult to grab/drag the window resize. On another mac the doc maybe pinned on the right or left, so my stack resize to screen depth would work fine as the doc would not overlap the resize feature. However to make matters worse, on another mac and the icons on the Doc could be larger than70px height so the resizing the stack becomes difficult again.

As the doc is Mac OS feature not sure it can be accessed/queried through LC. I could use the formula so

if its a mac then
set stack screen depth - 110
end if

...and just hope no one has 'bigger icons'

Thanks
Jalz

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Get Mac OS Dock size

Post by Simon » Wed Sep 17, 2014 11:52 pm

Yes, I'm using the the screendepth and then item 4 to determine how much horizontal screen space I have.
?
screenRect right?
But sure.. check out what that "working" does :)
From the Dictionary
Adding the working adjective to either form returns the virtual co-ordinates of each screen's working-area. The working-area of a screen is defined to be the area not covered by OS furniture (such as the task bar on Windows, and the Dock and Menubar on Mac OS X).
:)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Get Mac OS Dock size

Post by jalz » Thu Sep 18, 2014 7:41 pm

Hi Simon,

Thanks, I missed the "Working" bit of your answer, skim reading thinking I was using screenRect anyway. After reading the definition again and using the adjectives the following seems to work.

put the effective working screenrect into tRect

I seem to need the effective adjective as well as working to get the appropriate area as without it, it seemed to just return the screen depth. I was testing this with resizing my dock.

Many thanks

Jalz

Post Reply